diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2014-05-29 10:01:13 -0400 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2014-05-29 10:03:26 -0400 |
commit | e7aca353f7af5d2dbed5f0e55c23d87f17c2406c (patch) | |
tree | 7284cea4904f804adfa84accdef68699b614dd1a /doop.c | |
parent | e5a8a0fbd70ee31a016b7cf1c4b8c07839c6cf97 (diff) | |
download | perl-e7aca353f7af5d2dbed5f0e55c23d87f17c2406c.tar.gz |
UV casting to avoid intermediate sign extension.
[perl #121746]
Fix for Coverity perl5 CIDs 29069, 29070, 29071:
Unintended sign extension: ... ... if ... U8 (8 bits unsigned) ... 32
bits, signed ... 64 bits, unsigned ... is greater than 0x7FFFFFFF,
the upper bits of the result will all be 1.
Diffstat (limited to 'doop.c')
-rw-r--r-- | doop.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -850,7 +850,7 @@ Perl_do_vecget(pTHX_ SV *sv, SSize_t offset, int size) ((UV) s[uoffset + 1] << 48) + ((UV) s[uoffset + 2] << 40) + ((UV) s[uoffset + 3] << 32) + - ( s[uoffset + 4] << 24); + ((UV) s[uoffset + 4] << 24); else if (uoffset + 6 >= srclen) retnum = ((UV) s[uoffset ] << 56) + @@ -867,7 +867,7 @@ Perl_do_vecget(pTHX_ SV *sv, SSize_t offset, int size) ((UV) s[uoffset + 3] << 32) + ((UV) s[uoffset + 4] << 24) + ((UV) s[uoffset + 5] << 16) + - ( s[uoffset + 6] << 8); + ((UV) s[uoffset + 6] << 8); } #endif } |