diff options
Diffstat (limited to 'binutils/rclex.l')
-rw-r--r-- | binutils/rclex.l | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/binutils/rclex.l b/binutils/rclex.l index eb33b4a..92b1ec7 100644 --- a/binutils/rclex.l +++ b/binutils/rclex.l @@ -308,6 +308,7 @@ handle_quotes (const char *input, unsigned long *len) char *ret, *s; const char *t; int ch; + int num_xdigits; ret = get_string (strlen (input) + 1); @@ -389,7 +390,11 @@ handle_quotes (const char *input, unsigned long *len) case 'x': ++t; ch = 0; - while (1) + /* We only handle single byte chars here. Make sure + we finish an escape sequence like "/xB0ABC" after + the first two digits. */ + num_xdigits = 2; + while (num_xdigits--) { if (*t >= '0' && *t <= '9') ch = (ch << 4) | (*t - '0'); |