summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Rühsen <tim.ruehsen@gmx.de>2017-10-04 13:22:43 +0200
committerAndreas K. Hüttel <dilfridge@gentoo.org>2017-10-05 13:09:30 +0200
commit4bc206eec5708d71b547437bbdc770b84b761822 (patch)
treee98446d6dd9ad5155144fa31f49b20d569f212ff
parentlib/punycode.c (decode_digit): Fix integer overflow (diff)
downloadglibc-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.c4
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 */