зеркало из https://github.com/mozilla/pjs.git
protects against crash when calling smprintf with a null argument. r=me, sr=darin@netscape. patch submitted by risto.kankkunen@iki.fi. bug number 100293.
This commit is contained in:
Родитель
8c500749fe
Коммит
c2bc6ca34d
|
@ -525,11 +525,12 @@ static int cvt_s(SprintfState *ss, const char *s, int width, int prec,
|
|||
PRUnichar buf[256];
|
||||
PRUnichar *retbuf = nsnull;
|
||||
|
||||
retbuf = UTF8ToUCS2(s, nsCRT::strlen(s), buf, 256);
|
||||
if (s) {
|
||||
retbuf = UTF8ToUCS2(s, nsCRT::strlen(s), buf, 256);
|
||||
|
||||
if(nsnull == retbuf)
|
||||
return -1;
|
||||
|
||||
if(nsnull == retbuf)
|
||||
return -1;
|
||||
}
|
||||
int ret = cvt_S(ss, retbuf, width, prec, flags);
|
||||
|
||||
if(retbuf != buf)
|
||||
|
|
Загрузка…
Ссылка в новой задаче