From 6a5a3037b4f6ab7807c59c351d1064d3515ef269 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Mon, 23 Jun 2014 13:23:47 +0100 Subject: [PATCH] avoid getting stuck on non-UTF-8 symbol encodings in bytecode Found by fuzz tester, and this bug seems to be a common reason for the fuzz test to time out. --- racket/src/racket/src/symbol.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/racket/src/racket/src/symbol.c b/racket/src/racket/src/symbol.c index 9068fdd366..41b031e670 100644 --- a/racket/src/racket/src/symbol.c +++ b/racket/src/racket/src/symbol.c @@ -611,11 +611,11 @@ const char *scheme_symbol_name_and_size(Scheme_Object *sym, uintptr_t *length, i if (ch > 127) { /* Decode UTF-8. */ mzchar buf[2]; - int ul = 2; + int ul = 1; while (1) { if (scheme_utf8_decode((unsigned char *)s, i, i + ul, buf, 0, 1, - NULL, 0, 0) > 0) + NULL, 0, '?') > 0) break; ul++; }