We got passed a NULL Dialect ptr and accessed it unprotected.

This commit is contained in:
Marcus Meissner 1999-02-28 11:03:33 +00:00 committed by Alexandre Julliard
parent cb28bdc2c8
commit a538888e11

View file

@ -349,6 +349,9 @@ int MAIN_GetLanguageID(LPCSTR Lang,LPCSTR Country,LPCSTR Charset,LPCSTR Dialect)
for (i=0;i<j;i++)
dialect[i]=tolower(Dialect[i]);
dialect[i]='\0';
} else {
dialect = malloc(1);
dialect[0] = '\0';
}
#define LANG_ENTRY_BEGIN(x,y) if(!strcmp(lang, x )) { \
@ -650,7 +653,7 @@ int MAIN_GetLanguageID(LPCSTR Lang,LPCSTR Country,LPCSTR Charset,LPCSTR Dialect)
end_MAIN_GetLanguageID:
if (Charset) free(charset);
if (Dialect) free(dialect);
free(dialect);
return ret;
}