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.
git-svn-id: svn://10.0.0.236/trunk@103738 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user