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