From dd9c46c80509bf58e579ee742e875d396f618984 Mon Sep 17 00:00:00 2001 From: Jean Boussier Date: Thu, 16 Jan 2025 15:22:49 +0100 Subject: [PATCH] Use RSTRING_END --- ext/json/ext/parser/parser.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/json/ext/parser/parser.c b/ext/json/ext/parser/parser.c index f777d763..f9ab9abf 100644 --- a/ext/json/ext/parser/parser.c +++ b/ext/json/ext/parser/parser.c @@ -1344,7 +1344,7 @@ static VALUE cParser_parse(JSON_ParserConfig *config, VALUE Vsource) JSON_ParserState _state = { .config = config, .cursor = RSTRING_PTR(Vsource), - .end = RSTRING_PTR(Vsource) + RSTRING_LEN(Vsource), + .end = RSTRING_END(Vsource), .stack = &stack, }; JSON_ParserState *state = &_state;