* Added a null pointer check to the 'language' variable to prevent crash
authorArt Cancro <ajc@citadel.org>
Wed, 25 Feb 2009 17:06:23 +0000 (17:06 +0000)
committerArt Cancro <ajc@citadel.org>
Wed, 25 Feb 2009 17:06:23 +0000 (17:06 +0000)
webcit/gettext.c

index d14ecada155270ff28c9c33490d1a6820ddd4759..917ee4bd30508f8159482cde961798279c4bdda3 100644 (file)
@@ -238,7 +238,7 @@ void preset_locale(void)
        char *language;
        
        language = getenv("WEBCIT_LANG");
-       if (!IsEmptyStr(language) && (strcmp(language, "UNLIMITED") != 0)) {
+       if ((language) && (!IsEmptyStr(language)) && (strcmp(language, "UNLIMITED") != 0)) {
                lprintf(9, "Nailing locale to %s\n", language);
                setlocale(LC_MESSAGES, language);
        }