зеркало из https://github.com/mozilla/pjs.git
bug 210109 : fix crash due to misaligned address (use PRUintn for '%2X' in PR_sscanf instead of char) r=wtc, sr=darin
This commit is contained in:
Родитель
1e7abb1d65
Коммит
fd5643f995
|
@ -463,13 +463,14 @@ char *DecodeQ(const char *in, PRUint32 length)
|
|||
if (dest == nsnull)
|
||||
return nsnull;
|
||||
while (length > 0) {
|
||||
PRUintn c = 0;
|
||||
switch (*in) {
|
||||
case '=':
|
||||
// check if |in| in the form of '=hh' where h is [0-9a-fA-F].
|
||||
if (length < 3 || !ISHEXCHAR(in[1]) || !ISHEXCHAR(in[2]))
|
||||
goto badsyntax;
|
||||
PR_sscanf(in + 1, "%2X", out);
|
||||
++out;
|
||||
PR_sscanf(in + 1, "%2X", &c);
|
||||
*out++ = (char) c;
|
||||
in += 3;
|
||||
length -= 3;
|
||||
break;
|
||||
|
|
Загрузка…
Ссылка в новой задаче