syslinux_parse: make print_escaped actually stop before `to'

The only current user is mboot.c32 which unfortunately is not covered
by regression tests.
This commit is contained in:
Andrei Borzenkov 2015-06-19 17:35:17 +03:00
parent 7bb7140df2
commit 8067fe28ed
1 changed files with 1 additions and 1 deletions

View File

@ -772,7 +772,7 @@ print_escaped (struct output_buffer *outbuf,
if (err)
return err;
outbuf->buf[outbuf->ptr++] = '\'';
for (ptr = from; *ptr; ptr++)
for (ptr = from; *ptr && ptr < to; ptr++)
{
if (*ptr == '\'')
{