mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-01-09 05:01:02 -08:00
Fix integer overflow check in json code
* src/json.c (json_to_lisp): Check for ptrdiff_t overflow, not fixnum overflow.
This commit is contained in:
parent
a04bf15130
commit
8e25ffeec6
1 changed files with 1 additions and 1 deletions
|
|
@ -815,7 +815,7 @@ json_to_lisp (json_t *json, struct json_configuration *conf)
|
|||
if (++lisp_eval_depth > max_lisp_eval_depth)
|
||||
xsignal0 (Qjson_object_too_deep);
|
||||
size_t size = json_array_size (json);
|
||||
if (FIXNUM_OVERFLOW_P (size))
|
||||
if (PTRDIFF_MAX < size)
|
||||
overflow_error ();
|
||||
Lisp_Object result = make_vector (size, Qunbound);
|
||||
for (ptrdiff_t i = 0; i < size; ++i)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue