texinfo-commits
[Top][All Lists]
Advanced

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

branch master updated: * info/nodes.c (get_tags_of_indirect_tags_table):


From: Patrice Dumas
Subject: branch master updated: * info/nodes.c (get_tags_of_indirect_tags_table): ignore a bogus entry in indirect tags table with a negative offset for a file.
Date: Tue, 08 Oct 2024 02:51:56 -0400

This is an automated email from the git hooks/post-receive script.

pertusus pushed a commit to branch master
in repository texinfo.

The following commit(s) were added to refs/heads/master by this push:
     new e8717b6aed * info/nodes.c (get_tags_of_indirect_tags_table): ignore a 
bogus entry in indirect tags table with a negative offset for a file.
e8717b6aed is described below

commit e8717b6aed4340f85e35f91983c6672bedd4848e
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Tue Oct 8 08:51:39 2024 +0200

    * info/nodes.c (get_tags_of_indirect_tags_table): ignore a bogus entry
    in indirect tags table with a negative offset for a file.
---
 ChangeLog    | 5 +++++
 info/nodes.c | 9 ++++++++-
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index e868b38928..9ab9e3b4b4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2024-10-08  Patrice Dumas  <pertusus@free.fr>
+
+       * info/nodes.c (get_tags_of_indirect_tags_table): ignore a bogus entry
+       in indirect tags table with a negative offset for a file.
+
 2024-10-07  Patrice Dumas  <pertusus@free.fr>
 
        * info/search.c (find_file_section): stop as soon as the position
diff --git a/info/nodes.c b/info/nodes.c
index 976fbc0d66..468be45274 100644
--- a/info/nodes.c
+++ b/info/nodes.c
@@ -385,17 +385,24 @@ get_tags_of_indirect_tags_table (FILE_BUFFER *file_buffer,
   while (line < end)
     {
       int colon;
+      long first_byte;
 
       colon = string_in_line (":", line);
 
       if (colon == -1)
         break;
 
+      first_byte = atol (line + colon);
+
+      /* ignore an entry with a bogus negative offset */
+      if (first_byte < 0)
+        continue;
+
       subfile = xmalloc (sizeof (SUBFILE));
       subfile->filename = xmalloc (colon);
       strncpy (subfile->filename, line, colon - 1);
       subfile->filename[colon - 1] = 0;
-      subfile->first_byte = (long) atol (line + colon);
+      subfile->first_byte = first_byte;
 
       add_pointer_to_array (subfile, subfiles_index, subfiles, 
                             subfiles_slots, 10);



reply via email to

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