Commit 3284eb34 by Tim Rühsen

lib/puny_decode: Fix integer overflow (found by fuzzing)

parent 16853b69
......@@ -93,10 +93,10 @@ enum { base = 36, tmin = 1, tmax = 26, skew = 38, damp = 700,
/* point (for use in representing integers) in the range 0 to */
/* base-1, or base if cp does not represent a value. */
static punycode_uint decode_digit(punycode_uint cp)
static unsigned decode_digit(int cp)
{
return 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);
}
/*** Platform-specific constants ***/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment