bug-texinfo
[Top][All Lists]
Advanced

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

info crashes if .infokey contains the "invalid" action


From: Ken Brown
Subject: info crashes if .infokey contains the "invalid" action
Date: Thu, 3 Mar 2016 19:21:46 -0500
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0

A Cygwin user reported a crash as in the subject. I traced it to line 468 of info/infokey.c, in which there is a reference to function_doc_array[a] with a == A_INVALID:

  ke.value.function = &function_doc_array[a];

As a result, ke.value.function contains garbage. The following patch appears to fix the problem in very limited testing:

Index: info/infokey.c
===================================================================
--- info/infokey.c      (revision 7037)
+++ info/infokey.c      (working copy)
@@ -465,7 +465,9 @@
                       KEYMAP_ENTRY ke;

                       ke.type = ISFUNC;
-                      ke.value.function = &function_doc_array[a];
+                      ke.value.function = a < A_NCOMMANDS ?
+                                &function_doc_array[a]
+                                : NULL;
                       To_seq (0);

                       if (section == info)

Ken



reply via email to

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