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