libutil: Fix infinite loop in filterANSIEscapes on '\r'

E.g. nix-instantiate --eval -E 'abort "\r"' hangs.

Found by afl-fuzz.
This commit is contained in:
Tuomas Tynkkynen
2018-02-19 23:20:26 +02:00
parent 056d28a601
commit 1d0e42879f
+1 -1
View File
@@ -1216,7 +1216,7 @@ std::string filterANSIEscapes(const std::string & s, unsigned int width)
else if (*i == '\r')
// do nothing for now
;
i++;
else {
t += *i++; w++;