HCoop
/
bpt
/
guile.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
19c0bd2
)
Avoid signed overflow in random.c.
author
Mark H Weaver
<mhw@netris.org>
Wed, 12 Mar 2014 00:15:27 +0000
(20:15 -0400)
committer
Mark H Weaver
<mhw@netris.org>
Wed, 12 Mar 2014 01:39:08 +0000
(21:39 -0400)
* libguile/random.c (scm_i_mask32): Avoid signed overflow from shifting
an unsigned char (promoted to signed int) 24 bits to the left.
libguile/random.c
patch
|
blob
|
blame
|
history
diff --git
a/libguile/random.c
b/libguile/random.c
index
18737aa
..
4051d1f
100644
(file)
--- a/
libguile/random.c
+++ b/
libguile/random.c
@@
-255,7
+255,7
@@
scm_i_mask32 (scm_t_uint32 m)
? scm_masktab[m >> 8] << 8 | 0xff
: (m < 0x1000000
? scm_masktab[m >> 16] << 16 | 0xffff
- :
scm_masktab[m >> 24]
<< 24 | 0xffffff)));
+ :
((scm_t_uint32) scm_masktab[m >> 24])
<< 24 | 0xffffff)));
}
scm_t_uint32