This is a live mirror of the Perl 5 development currently hosted at
https://github.com/perl/perl5
https://perl5.git.perl.org
/
perl5.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ed6087a
)
XS-APItest: Length cannot be negative.
author
Jarkko Hietaniemi
<jhi@iki.fi>
Thu, 4 Feb 2016 02:42:36 +0000
(21:42 -0500)
committer
Jarkko Hietaniemi
<jhi@iki.fi>
Sun, 7 Feb 2016 13:23:46 +0000
(08:23 -0500)
Coverity CID 135019: Argument cannot be negative (NEGATIVE_RETURNS)
ext/XS-APItest/APItest.xs
patch
|
blob
|
blame
|
history
diff --git
a/ext/XS-APItest/APItest.xs
b/ext/XS-APItest/APItest.xs
index
d7376ba
..
bbd00c7
100644
(file)
--- a/
ext/XS-APItest/APItest.xs
+++ b/
ext/XS-APItest/APItest.xs
@@
-5490,6
+5490,7
@@
test_Gconvert(SV * number, SV * num_digits)
CODE:
len = (int) SvIV(num_digits);
if (len > 99) croak("Too long a number for test_Gconvert");
+ if (len < 0) croak("Too short a number for test_Gconvert");
PERL_UNUSED_RESULT(Gconvert(SvNV(number), len,
0, /* No trailing zeroes */
buffer));