[vim/vim] fix: prevent stack overflow in json_encode/json_decode for deeply nested data (PR #19808)

4 views
Skip to first unread message

mattn

unread,
7:40 AM (16 hours ago) 7:40 AM
to vim/vim, Subscribed

json_encode() crashes with segfault on deeply nested structures due to unbounded recursion. vim -u NONE --cmd 'let l=[]' --cmd 'call map(range(1024*1024), "extend(g:, {\"l\": [g:l]})")' --cmd 'echo json_encode(l)' Add depth limit checks using 'maxfuncdepth' to json_encode_item() and json_decode_item().


You can view, comment on, or merge this pull request online at:

  https://github.com/vim/vim/pull/19808

Commit Summary

  • 2ffb6f8 fix: prevent stack overflow in json_encode/json_decode for deeply nested data

File Changes

(2 files)

Patch Links:


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19808@github.com>

mattn

unread,
7:57 AM (15 hours ago) 7:57 AM
to vim/vim, Push

@mattn pushed 1 commit.

  • 7380ee1 fix: prevent stack overflow in json_encode/json_decode for deeply nested data


View it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19808/before/2ffb6f88c254c643d2ab63cad38f8f8ea8b2531c/after/7380ee1f9f036b4aba115bffc8ac4aa00c8a5ea1@github.com>

Christian Brabandt

unread,
3:10 PM (8 hours ago) 3:10 PM
to vim/vim, Subscribed
chrisbra left a comment (vim/vim#19808)

thanks


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19808/c4120726542@github.com>

Christian Brabandt

unread,
3:32 PM (8 hours ago) 3:32 PM
to vim/vim, Subscribed

Closed #19808 via abd2d7d.


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19808/issue_event/23864912512@github.com>

Reply all
Reply to author
Forward
0 new messages