[mythtv-commits] Ticket #10005: If $LANG isn't set, mythbackend segfaults after v0.25pre-3161-g0fd3987
MythTV
noreply at mythtv.org
Wed Aug 24 03:18:20 UTC 2011
#10005: If $LANG isn't set, mythbackend segfaults after v0.25pre-3161-g0fd3987
--------------------------------------------+------------------------------
Reporter: Bill Meek <keemllib@…> | Type: Patch - Bug
Status: new | Fix
Milestone: unknown | Priority: minor
Version: Trunk Head | Component: MythTV -
Keywords: | General
| Severity: medium
| Ticket locked: 0
--------------------------------------------+------------------------------
Running on Ubuntu 10.04.3 LTS, starting mythbackend from upstart,
LANG is not set. 0fd3987 adds a check for it, but segfaults if it
is not set.
/var/log/mythtv/mythbackend.*.PID.log size is 0.
The following patch eliminates the segfault and allows the error
message to print.
{{{
diff --git a/mythtv/libs/libmythbase/mythcorecontext.cpp
b/mythtv/libs/libmythbase/mythcorecontext.cpp
index 960ccbb..f3ddfbc 100644
--- a/mythtv/libs/libmythbase/mythcorecontext.cpp
+++ b/mythtv/libs/libmythbase/mythcorecontext.cpp
@@ -194,7 +194,7 @@ bool MythCoreContext::Init(void)
#ifndef _WIN32
char *lang = getenv("LANG");
- if (!strcmp(lang, "C") || (strlen(lang) == 0))
+ if (lang == 0 || !strcmp(lang, "C") || (strlen(lang) == 0))
LOG(VB_GENERAL, LOG_WARNING,
"This application expects to be running a UTF locale, and
"
"many features may behave improperly with your current
LANG "
}}}
--
Ticket URL: <http://code.mythtv.org/trac/ticket/10005>
MythTV <http://code.mythtv.org/trac>
MythTV Media Center
More information about the mythtv-commits
mailing list