texinfo-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[7254] forward_to_info_syntax don't read past end of string


From: gavinsmith0123
Subject: [7254] forward_to_info_syntax don't read past end of string
Date: Sun, 10 Jul 2016 19:24:15 +0000 (UTC)

Revision: 7254
          http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=7254
Author:   gavin
Date:     2016-07-10 19:24:14 +0000 (Sun, 10 Jul 2016)
Log Message:
-----------
forward_to_info_syntax don't read past end of string

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/info/info-utils.c

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog     2016-07-10 19:18:02 UTC (rev 7253)
+++ trunk/ChangeLog     2016-07-10 19:24:14 UTC (rev 7254)
@@ -1,5 +1,10 @@
 2016-07-10  Gavin Smith  <address@hidden>
 
+       * info/info-utils.c (forward_to_info_syntax): Avoid reading past 
+       end of string.  Report by Hanno B\xF6ck.
+
+2016-07-10  Gavin Smith  <address@hidden>
+
        * NEWS: Mention @ktable.
        * doc/texinfo.texi (Command List) <@asis, @ktable>: Mention 
        @ktable.

Modified: trunk/info/info-utils.c
===================================================================
--- trunk/info/info-utils.c     2016-07-10 19:18:02 UTC (rev 7253)
+++ trunk/info/info-utils.c     2016-07-10 19:24:14 UTC (rev 7254)
@@ -1576,7 +1576,10 @@
 static char *
 forward_to_info_syntax (char *contents)
 {
-  while (contents < input_start + input_length)
+  /* Loop until just before the end of the input.  The '- 3' prevents us
+     accessing memory after the end of the input, and none of the strings we 
+     are looking for are shorter than 3 bytes. */
+  while (contents < input_start + input_length - 3)
     {
       /* Menu entry comes first to optimize for the case of looking through a 
          long index node. */




reply via email to

[Prev in Thread] Current Thread [Next in Thread]