[ruby/json] Fix potential out of bound read in json_string_unescape
.
https://github.com/ruby/json/commit/cf242d89a0
This commit is contained in:
parent
8cc85dc00f
commit
e6a2cf9fd7
@ -608,7 +608,7 @@ static VALUE json_string_unescape(JSON_ParserState *state, const char *string, c
|
|||||||
buffer = RSTRING_PTR(result);
|
buffer = RSTRING_PTR(result);
|
||||||
bufferStart = buffer;
|
bufferStart = buffer;
|
||||||
|
|
||||||
while ((pe = memchr(pe, '\\', stringEnd - pe))) {
|
while (pe < stringEnd && (pe = memchr(pe, '\\', stringEnd - pe))) {
|
||||||
unescape = (char *) "?";
|
unescape = (char *) "?";
|
||||||
unescape_len = 1;
|
unescape_len = 1;
|
||||||
if (pe > p) {
|
if (pe > p) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user