From: Paul Eggert Date: Tue, 1 Jan 2019 07:07:33 +0000 (-0800) Subject: Fix integer overflow check in json code X-Git-Tag: emacs-27.0.90~3887 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=8e25ffeec6345249f2a5d221fcb0622d1deaee27;p=emacs.git Fix integer overflow check in json code * src/json.c (json_to_lisp): Check for ptrdiff_t overflow, not fixnum overflow. --- diff --git a/src/json.c b/src/json.c index 46fb97a99e8..b5fb3fee059 100644 --- a/src/json.c +++ b/src/json.c @@ -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)