diff options
author | Tim Rühsen <tim.ruehsen@gmx.de> | 2017-10-04 13:22:43 +0200 |
---|---|---|
committer | Andreas K. Hüttel <dilfridge@gentoo.org> | 2017-10-05 13:09:30 +0200 |
commit | 4bc206eec5708d71b547437bbdc770b84b761822 (patch) | |
tree | e98446d6dd9ad5155144fa31f49b20d569f212ff | |
parent | lib/punycode.c (decode_digit): Fix integer overflow (diff) | |
download | glibc-gentoo/glibc-2.25-11.tar.gz glibc-gentoo/glibc-2.25-11.tar.bz2 glibc-gentoo/glibc-2.25-11.zip |
libidn/punycode.c (decode_digit): Really fix integer overflowgentoo/glibc-2.25-11
libidn/punycode.c (decode_digit): Really fix integer overflow
The fix in commit e9e81b8063b095b02cf104bb992fa9bf9515b9d8
was incomplete.
Reported-by: Christian Weisgerber
-rw-r--r-- | libidn/punycode.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libidn/punycode.c b/libidn/punycode.c index 49c660184e..4c7c865325 100644 --- a/libidn/punycode.c +++ b/libidn/punycode.c @@ -81,8 +81,8 @@ enum static unsigned decode_digit (int cp) { - return (unsigned) cp - 48 < 10 ? cp - 22 : cp - 65 < 26 ? cp - 65 : - cp - 97 < 26 ? cp - 97 : base; + return (unsigned) (cp - 48 < 10 ? cp - 22 : cp - 65 < 26 ? cp - 65 : + cp - 97 < 26 ? cp - 97 : base); } /* encode_digit(d,flag) returns the basic code point whose value */ |