Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 34b5f62

Browse files
rurbantonycoz
authored andcommittedFeb 8, 2018
Storable 3.05_11: croak on sizes read > I32_MAX
detected by coverity: CID 165606 (#2 of 2): Untrusted value as argument (TAINTED_SCALAR) 146. tainted_data: Passing tainted variable size to a tainted sink. (cherry picked from commit 735d922) Conflicts: dist/Storable/Storable.pm
1 parent ead977b commit 34b5f62

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed
 

‎dist/Storable/Storable.xs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -566,6 +566,8 @@ static stcxt_t *Context_ptr = NULL;
566566
#define KBUFCHK(x) \
567567
STMT_START { \
568568
if (x >= ksiz) { \
569+
if (x >= I32_MAX) \
570+
CROAK(("Too large size > I32_MAX")); \
569571
TRACEME(("** extending kbuf to %d bytes (had %d)", \
570572
(int)(x+1), (int)ksiz)); \
571573
Renew(kbuf, x+1, char); \
@@ -5863,8 +5865,7 @@ static SV *retrieve_svundef_elem(pTHX_ stcxt_t *cxt, const char *cname)
58635865
*/
58645866
static SV *retrieve_array(pTHX_ stcxt_t *cxt, const char *cname)
58655867
{
5866-
I32 len;
5867-
I32 i;
5868+
I32 len, i;
58685869
AV *av;
58695870
SV *sv;
58705871
HV *stash;

0 commit comments

Comments
 (0)
Please sign in to comment.