Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix seg faults in SAJ parser #799

Merged
merged 1 commit into from Jul 29, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions ext/oj/saj2.c
Expand Up @@ -289,15 +289,15 @@ static void add_float_key_loc(ojParser p) {
}

static void add_big(ojParser p) {
rb_funcall((VALUE)p->ctx,
rb_funcall(((Delegate)p->ctx)->handler,
oj_add_value_id,
2,
rb_funcall(rb_cObject, oj_bigdecimal_id, 1, rb_str_new(buf_str(&p->buf), buf_len(&p->buf))),
Qnil);
}

static void add_big_loc(ojParser p) {
rb_funcall((VALUE)p->ctx,
rb_funcall(((Delegate)p->ctx)->handler,
oj_add_value_id,
4,
rb_funcall(rb_cObject, oj_bigdecimal_id, 1, rb_str_new(buf_str(&p->buf), buf_len(&p->buf))),
Expand All @@ -307,7 +307,7 @@ static void add_big_loc(ojParser p) {
}

static void add_big_key(ojParser p) {
rb_funcall((VALUE)p->ctx,
rb_funcall(((Delegate)p->ctx)->handler,
oj_add_value_id,
2,
rb_funcall(rb_cObject, oj_bigdecimal_id, 1, rb_str_new(buf_str(&p->buf), buf_len(&p->buf))),
Expand Down