bug 109411, prevent malloc of 0, c=pedemonte, r=morse, sr=alecf

This commit is contained in:
morse%netscape.com 2001-11-11 08:27:05 +00:00
Родитель 6dff931971
Коммит 9b1c2f6ee0
1 изменённых файлов: 6 добавлений и 0 удалений

Просмотреть файл

@ -1109,6 +1109,12 @@ si_GetURLAndUserForChangeForm(nsIPrompt* dialog, const nsString& password)
}
}
/* avoid malloc of zero */
if( user_count == 0 )
{
return NULL;
}
/* allocate lists for maximumum possible url and user names */
list = (PRUnichar**)PR_Malloc(user_count*sizeof(PRUnichar*));
users = (si_SignonUserStruct **) PR_Malloc(user_count*sizeof(si_SignonUserStruct*));