commit 70adb1252dd154bd6517af49e916b8f2d4deeac9
Author: FRIGN <[email protected]>
AuthorDate: Sat Feb 20 21:50:21 2016 +0100
Commit: sin <[email protected]>
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++)