From 1e6396ec3df3b55cebf0f7380ed6dd43775a3a5b Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sat, 8 Jun 2019 23:38:18 -0700 Subject: [PATCH] =?utf8?q?Fix=20int=20overflow=20bug=20in=20=E2=80=98equal?= =?utf8?q?=E2=80=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit * src/fns.c (internal_equal): Fix bug when vector lengths exceed INT_MAX. --- src/fns.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/fns.c b/src/fns.c index 7d5443150d4..8307a36a09d 100644 --- a/src/fns.c +++ b/src/fns.c @@ -2425,7 +2425,6 @@ internal_equal (Lisp_Object o1, Lisp_Object o2, enum equal_kind equal_kind, case Lisp_Vectorlike: { - register int i; ptrdiff_t size = ASIZE (o1); /* Pseudovectors have the type encoded in the size field, so this test actually checks that the objects have the same type as well as the @@ -2479,7 +2478,7 @@ internal_equal (Lisp_Object o1, Lisp_Object o2, enum equal_kind equal_kind, return false; size &= PSEUDOVECTOR_SIZE_MASK; } - for (i = 0; i < size; i++) + for (ptrdiff_t i = 0; i < size; i++) { Lisp_Object v1, v2; v1 = AREF (o1, i); -- 2.39.2