Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
local: fix possible out-of-array access, fixes #2972
  • Loading branch information
perexg committed Jun 25, 2015
1 parent 28e05b8 commit e107208
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/tvh_locale.c
Expand Up @@ -180,13 +180,13 @@ static void tvh_gettext_default_init(void)

strncpy(dflt, p, sizeof(dflt)-1);
dflt[sizeof(dflt)-1] = '\0';
for (p = dflt; p && *p != '.'; p++);
for (p = dflt; *p && *p != '.'; p++);
if (*p == '.') *p = '\0';

if ((lng_default = lng_get_locale(dflt)) != NULL)
return;

for (p = dflt; p && *p != '_'; p++);
for (p = dflt; *p && *p != '_'; p++);
if (*p == '_') *p = '\0';

if ((lng_default = lng_get_locale(dflt)) != NULL)
Expand Down

0 comments on commit e107208

Please sign in to comment.