7e35ac
From f7724052d1b8b75339f5ec2cc3d5b35ca5d130b5 Mon Sep 17 00:00:00 2001
7e35ac
From: Tony Cook <tony@develop-help.com>
7e35ac
Date: Wed, 7 Aug 2019 11:13:53 +1000
7e35ac
Subject: [PATCH] Storable: make count large enough
7e35ac
MIME-Version: 1.0
7e35ac
Content-Type: text/plain; charset=UTF-8
7e35ac
Content-Transfer-Encoding: 8bit
7e35ac
7e35ac
AvARRAY() could be very large, and we check for that at line 3807,
7e35ac
but int was (potentially) too small to make that comparison
7e35ac
meaningful.
7e35ac
7e35ac
CID 174681.
7e35ac
7e35ac
Signed-off-by: Petr Písař <ppisar@redhat.com>
7e35ac
---
7e35ac
 dist/Storable/Storable.xs | 6 +++---
7e35ac
 1 file changed, 3 insertions(+), 3 deletions(-)
7e35ac
7e35ac
diff --git a/dist/Storable/Storable.xs b/dist/Storable/Storable.xs
7e35ac
index 6a45d8adf2..d75125b839 100644
7e35ac
--- a/dist/Storable/Storable.xs
7e35ac
+++ b/dist/Storable/Storable.xs
7e35ac
@@ -3662,7 +3662,7 @@ static int store_hook(
7e35ac
     SV *ref;
7e35ac
     AV *av;
7e35ac
     SV **ary;
7e35ac
-    int count;			/* really len3 + 1 */
7e35ac
+    IV count;			/* really len3 + 1 */
7e35ac
     unsigned char flags;
7e35ac
     char *pv;
7e35ac
     int i;
7e35ac
@@ -3752,7 +3752,7 @@ static int store_hook(
7e35ac
     SvREFCNT_dec(ref);			/* Reclaim temporary reference */
7e35ac
 
7e35ac
     count = AvFILLp(av) + 1;
7e35ac
-    TRACEME(("store_hook, array holds %d items", count));
7e35ac
+    TRACEME(("store_hook, array holds %" IVdf " items", count));
7e35ac
 
7e35ac
     /*
7e35ac
      * If they return an empty list, it means they wish to ignore the
7e35ac
@@ -3986,7 +3986,7 @@ static int store_hook(
7e35ac
      */
7e35ac
 
7e35ac
     TRACEME(("SX_HOOK (recursed=%d) flags=0x%x "
7e35ac
-             "class=%" IVdf " len=%" IVdf " len2=%" IVdf " len3=%d",
7e35ac
+             "class=%" IVdf " len=%" IVdf " len2=%" IVdf " len3=%" IVdf,
7e35ac
              recursed, flags, (IV)classnum, (IV)len, (IV)len2, count-1));
7e35ac
 
7e35ac
     /* SX_HOOK <flags> [<extra>] */
7e35ac
-- 
7e35ac
2.20.1
7e35ac