based on:
To: Brian Keefer <mgomes@cwix.com>
Cc: perl5-porters@perl.org
Subject: Re: [ID
19990806.001] Core dump with obfuscated code
Message-ID: <14250.27711.769942.100675@localhost.frii.com>
p4raw-id: //depot/cfgperl@3928
checksumming process loses information, and you can't go the other
way. See L<perlfunc/unpack>.
+=item Repeat count in pack overflows
+
+(F) You can't specify a repeat count so large that it overflows
+your signed integers. See L<perlfunc/pack>.
+
+=item Repeat count in unpack overflows
+
+(F) You can't specify a repeat count so large that it overflows
+your signed integers. See L<perlfunc/unpack>.
+
=item /%s/: Unrecognized escape \\%c passed through
(W) You used a backslash-character combination which is not recognized
}
else if (isDIGIT(*pat)) {
len = *pat++ - '0';
- while (isDIGIT(*pat))
+ while (isDIGIT(*pat)) {
len = (len * 10) + (*pat++ - '0');
+ if (len < 0)
+ Perl_croak(aTHX_ "Repeat count in unpack overflows");
+ }
}
else
len = (datumtype != '@');
}
else if (isDIGIT(*pat)) {
len = *pat++ - '0';
- while (isDIGIT(*pat))
+ while (isDIGIT(*pat)) {
len = (len * 10) + (*pat++ - '0');
+ if (len < 0)
+ Perl_croak(aTHX_ "Repeat count in pack overflows");
+ }
}
else
len = 1;