texinfo-commits
[Top][All Lists]
Advanced

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

branch master updated: Fix info 'invalid' key mapping segfault


From: Gavin D. Smith
Subject: branch master updated: Fix info 'invalid' key mapping segfault
Date: Wed, 17 Jan 2024 14:52:48 -0500

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

gavin pushed a commit to branch master
in repository texinfo.

The following commit(s) were added to refs/heads/master by this push:
     new 179b5a5530 Fix info 'invalid' key mapping segfault
179b5a5530 is described below

commit 179b5a5530cfa5d52840a1e5114b64c798f83221
Author: Gavin Smith <gavinsmith0123@gmail.com>
AuthorDate: Wed Jan 17 19:51:00 2024 +0000

    Fix info 'invalid' key mapping segfault
    
    * info/infodoc.c (dump_map_to_text_buffer): Check for "invalid"
    entry in key map by checking if a function pointer is null.  This
    prevents a crash in 'function_documentation' from dereferencing
    a null pointer if an "invalid" entry was provided in the infokey
    file.
    
    Report from Bugsy Abatantuono <bugsyabatantuono@proton.me>.
---
 ChangeLog      | 12 ++++++++++++
 info/infodoc.c |  4 ++--
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 01976f7b0b..c1f8c95ccd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2024-01-17  Gavin Smith <gavinsmith0123@gmail.com>
+
+       Fix info 'invalid' key mapping segfault
+
+       * info/infodoc.c (dump_map_to_text_buffer): Check for "invalid"
+       entry in key map by checking if a function pointer is null.  This
+       prevents a crash in 'function_documentation' from dereferencing
+       a null pointer if an "invalid" entry was provided in the infokey
+       file.
+
+       Report from Bugsy Abatantuono <bugsyabatantuono@proton.me>.
+
 2024-01-17  Patrice Dumas  <pertusus@free.fr>
 
        Add initialization and finalization of conversion, separate document
diff --git a/info/infodoc.c b/info/infodoc.c
index 7e79211ebd..f115ab7062 100644
--- a/info/infodoc.c
+++ b/info/infodoc.c
@@ -111,8 +111,8 @@ dump_map_to_text_buffer (struct text_buffer *tb, int 
*prefix,
           char *doc, *name;
 
           /* Hide some key mappings. */
-          if (map[i].value.function
-              && (map[i].value.function->func == info_do_lowercase_version))
+          if (!map[i].value.function->func /* "invalid" mapping */
+              || map[i].value.function->func == info_do_lowercase_version)
             continue;
 
           doc = function_documentation (map[i].value.function);



reply via email to

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