]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
syslinux_parse: make print_escaped actually stop before `to'
authorAndrei Borzenkov <arvidjaar@gmail.com>
Fri, 19 Jun 2015 14:35:17 +0000 (17:35 +0300)
committerAndrei Borzenkov <arvidjaar@gmail.com>
Fri, 19 Jun 2015 14:35:17 +0000 (17:35 +0300)
The only current user is mboot.c32 which unfortunately is not covered
by regression tests.

grub-core/lib/syslinux_parse.c

index 153260b5410ee3b01cf123160c1d8d49519da72a..ba71a483100799e1eca2a960a12773237a036132 100644 (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 == '\'')
        {