]> git.eshelyaron.com Git - emacs.git/commit
Respect narrowed buffers when parsing JSON (bug#77325)
authorPip Cet <pipcet@protonmail.com>
Fri, 28 Mar 2025 02:33:19 +0000 (02:33 +0000)
committerEshel Yaron <me@eshelyaron.com>
Mon, 31 Mar 2025 08:54:52 +0000 (10:54 +0200)
commitb104cb03fe0ec1aba3906031c846d52903846c8d
tree1b2af20d1832392ac3b7fdeec1a928c4a09b7def
parente9f1c086142c28abb54651c03f3345024d737d60
Respect narrowed buffers when parsing JSON (bug#77325)

* src/json.c (Fjson_insert): Simplify 'memcpy' argument.
(Fjson_parse_buffer): Only read to ZV, not all the way to Z.
* test/src/json-tests.el (with-all-gap-positions-in-temp-buffer):
New macro.
(json-parse-buffer/restricted): New test.

(cherry picked from commit 67e34f0ed8f6d3bbc78187a18f71010c70e10426)
src/json.c
test/src/json-tests.el