зеркало из https://github.com/mozilla/gecko-dev.git
Add a check for a NULL str before passing it to strcmp().
Otherwise, Linux and possibly other platforms with strict strcmp() implementations will crash when the plugin list is NULL. Thanks to pollmann@netscape.com.
This commit is contained in:
Родитель
4f6c1e3cc1
Коммит
c9ae415b14
|
@ -1102,9 +1102,15 @@ void XFE_PrefsApplEditDialog::buildPluginList(char *mimeType)
|
|||
while (plugins[i]) {
|
||||
xms = XmStringCreateLtoR(plugins[i], XmFONTLIST_DEFAULT_TAG);
|
||||
DtComboBoxAddItem(fep->plugin_combo, xms, 0, True);
|
||||
if ((i == 0) ||
|
||||
(!strcmp(current_plugin, plugins[i])))
|
||||
|
||||
/*
|
||||
* Linux crashes in strcmp() if current_plugin is NULL, so
|
||||
* make sure it aint
|
||||
*/
|
||||
if ((i == 0) || (current_plugin && (!strcmp(current_plugin, plugins[i]))))
|
||||
{
|
||||
DtComboBoxSelectItem(fep->plugin_combo, xms);
|
||||
}
|
||||
XmStringFree(xms);
|
||||
i++;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче