diff --git a/mozilla/modules/plugin/base/src/nsPluginsDirWin.cpp b/mozilla/modules/plugin/base/src/nsPluginsDirWin.cpp index d49ff833c9a..2e433e057d7 100644 --- a/mozilla/modules/plugin/base/src/nsPluginsDirWin.cpp +++ b/mozilla/modules/plugin/base/src/nsPluginsDirWin.cpp @@ -67,7 +67,7 @@ static char* GetKeyValue(char* verbuf, char* key) static PRUint32 CalculateVariantCount(char* mimeTypes) { - PRUint32 variants = 0; + PRUint32 variants = 1; char* index = mimeTypes; while (*index) { @@ -86,13 +86,17 @@ static char** MakeStringArray(PRUint32 variants, char* data) PRUint32 count = 0; buffer = (char **)PR_Malloc(variants * sizeof(char *)); - buffer[count++] = index; + if(!buffer) + return NULL; + buffer[count] = index; + ++count; while (*index && count