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