Skip to content

Commit 162b6fd

Browse files
committed
Assert on args to padnamelist_dup() before trying to use them
1 parent fb4d3f5 commit 162b6fd

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

pad.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2744,13 +2744,12 @@ Duplicates a pad name list.
27442744
PADNAMELIST *
27452745
Perl_padnamelist_dup(pTHX_ PADNAMELIST *srcpad, CLONE_PARAMS *param)
27462746
{
2747-
PADNAMELIST *dstpad;
2748-
SSize_t max = PadnamelistMAX(srcpad);
2749-
27502747
PERL_ARGS_ASSERT_PADNAMELIST_DUP;
27512748

2749+
SSize_t max = PadnamelistMAX(srcpad);
2750+
27522751
/* look for it in the table first */
2753-
dstpad = (PADNAMELIST *)ptr_table_fetch(PL_ptr_table, srcpad);
2752+
PADNAMELIST *dstpad = (PADNAMELIST *)ptr_table_fetch(PL_ptr_table, srcpad);
27542753
if (dstpad)
27552754
return dstpad;
27562755

0 commit comments

Comments
 (0)