Fix potential NULL dereference in new code for surrogate escapes, discovered by
Coverity Scan.
This commit is contained in:
parent
231a800557
commit
fef4de56a1
|
@ -1667,8 +1667,8 @@ else
|
||||||
}
|
}
|
||||||
else if (ptr < ptrend && *ptr++ == CHAR_RIGHT_CURLY_BRACKET)
|
else if (ptr < ptrend && *ptr++ == CHAR_RIGHT_CURLY_BRACKET)
|
||||||
{
|
{
|
||||||
if (utf && c >= 0xd800 && c <= 0xdfff &&
|
if (utf && c >= 0xd800 && c <= 0xdfff && (cb == NULL ||
|
||||||
(cb->cx->extra_options & PCRE2_EXTRA_ALLOW_SURROGATE_ESCAPES) == 0)
|
(cb->cx->extra_options & PCRE2_EXTRA_ALLOW_SURROGATE_ESCAPES) == 0))
|
||||||
{
|
{
|
||||||
ptr--;
|
ptr--;
|
||||||
*errorcodeptr = ERR73;
|
*errorcodeptr = ERR73;
|
||||||
|
@ -1737,8 +1737,8 @@ else
|
||||||
}
|
}
|
||||||
else if (ptr < ptrend && *ptr++ == CHAR_RIGHT_CURLY_BRACKET)
|
else if (ptr < ptrend && *ptr++ == CHAR_RIGHT_CURLY_BRACKET)
|
||||||
{
|
{
|
||||||
if (utf && c >= 0xd800 && c <= 0xdfff &&
|
if (utf && c >= 0xd800 && c <= 0xdfff && (cb == NULL ||
|
||||||
(cb->cx->extra_options & PCRE2_EXTRA_ALLOW_SURROGATE_ESCAPES) == 0)
|
(cb->cx->extra_options & PCRE2_EXTRA_ALLOW_SURROGATE_ESCAPES) == 0))
|
||||||
{
|
{
|
||||||
ptr--;
|
ptr--;
|
||||||
*errorcodeptr = ERR73;
|
*errorcodeptr = ERR73;
|
||||||
|
|
Loading…
Reference in New Issue