Subject: Re: bug#42113: 28.0.50; Segmentation fault in json-parse-file

From: Philipp Stephani <[email-masked]>
Date: Mon, 29 Jun 2020 10:33:45 +0200

Am So., 28. Juni 2020 um 23:53 Uhr schrieb Erik Hetzner <[email-masked]>:
>
> 1. Start emacs -Q
> 2. Evaluate the following
> (require 'dom)
>
> (with-current-buffer (url-retrieve-synchronously "https://www.seriouseats.com/recipes/2020/06/florentine-omelette-spinach-and-cheese.html")
>         (let* ((dom (libxml-parse-html-region (point-min) (point-max)))
>                (scripts (dom-by-tag dom 'script))
>                (json-lds-raw (dom-elements scripts 'type "^application/ld\\+json$"))
>                (json-lds (mapcar #'json-parse-string json-lds-raw)))))
>
> Result: segmentation fault.

Simpler: (json-parse-string 1)
The JSON functions are missing CHECK_STRING in several places where
json_encode is called.