зеркало из https://github.com/mozilla/pjs.git
Fixing #13783 (garbage-pointer dereference)
This commit is contained in:
Родитель
6a6348bb78
Коммит
0d9360ceab
|
@ -109,6 +109,9 @@ nsPluginTag::nsPluginTag()
|
|||
|
||||
inline char* new_str(char* str)
|
||||
{
|
||||
if(str == nsnull)
|
||||
return nsnull;
|
||||
|
||||
char* result = new char[strlen(str) + 1];
|
||||
if (result != nsnull)
|
||||
return strcpy(result, str);
|
||||
|
|
|
@ -92,7 +92,7 @@ static char** MakeStringArray(PRUint32 variants, char* data)
|
|||
if((variants == 0) || (data == NULL))
|
||||
return NULL;
|
||||
|
||||
buffer = (char **)PR_Malloc(variants * sizeof(char *));
|
||||
buffer = (char **)PR_Calloc(variants, sizeof(char *));
|
||||
if(!buffer)
|
||||
return NULL;
|
||||
buffer[count] = index;
|
||||
|
|
|
@ -109,6 +109,9 @@ nsPluginTag::nsPluginTag()
|
|||
|
||||
inline char* new_str(char* str)
|
||||
{
|
||||
if(str == nsnull)
|
||||
return nsnull;
|
||||
|
||||
char* result = new char[strlen(str) + 1];
|
||||
if (result != nsnull)
|
||||
return strcpy(result, str);
|
||||
|
|
|
@ -92,7 +92,7 @@ static char** MakeStringArray(PRUint32 variants, char* data)
|
|||
if((variants == 0) || (data == NULL))
|
||||
return NULL;
|
||||
|
||||
buffer = (char **)PR_Malloc(variants * sizeof(char *));
|
||||
buffer = (char **)PR_Calloc(variants, sizeof(char *));
|
||||
if(!buffer)
|
||||
return NULL;
|
||||
buffer[count] = index;
|
||||
|
|
Загрузка…
Ссылка в новой задаче