commit 70adb1252dd154bd6517af49e916b8f2d4deeac9 Author: FRIGN <d...@frign.de> AuthorDate: Sat Feb 20 21:50:21 2016 +0100 Commit: sin <s...@2f30.org> CommitDate: Sun Feb 21 08:52:48 2016 +0000
Do a range check on the resulting octal diff --git a/libutil/unescape.c b/libutil/unescape.c index 627c2a2..be18d1f 100644 --- a/libutil/unescape.c +++ b/libutil/unescape.c @@ -62,7 +62,7 @@ unescape(char *s) q += (s[m] - '0') * factor; factor *= 8; } - s[i] = q; + s[i] = (q > 255) 255 : q; } for (m = i + 1; m <= len - off; m++)