[21.5] Support builtin functions in find-function (crash in C-h f)

Stephen J. Turnbull stephen at xemacs.org
Mon May 1 11:44:41 EDT 2006


>>>>> "Aidan" == Aidan Kehoe <kehoea at parhasard.net> writes:

    Aidan> It’s a platform-specific crash that happens on a platform I
    Aidan> don’t have access to.

It's not platform-specific, it's just an obvious buffer overrun.

Adding 1 to the dimension of buf fixes the crash for me.  Please
review and make sure that's everything.

diff --git a/src/ChangeLog b/src/ChangeLog
index cdf3be7..536e1df 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -0,0 +1,4 @@
+2006-05-02  Stephen J. Turnbull  <stephen at xemacs.org>
+
+	* doc.c (extract_object_file_name): Fix buffer overrun.
+

diff --git a/src/doc.c b/src/doc.c
index 0066c5b..fa111a5 100644
--- a/src/doc.c
+++ b/src/doc.c
@@ -47,7 +47,7 @@ extract_object_file_name (int fd, EMACS_
 			  Ibyte *name_nonreloc, Lisp_Object name_reloc,
 			  int standard_doc_file)
 {
-  Ibyte buf[DOC_MAX_FILENAME_LENGTH];
+  Ibyte buf[DOC_MAX_FILENAME_LENGTH+1];
   Ibyte *buffer = buf;
   int buffer_size = sizeof (buf), space_left;
   Ibyte *from, *to;



-- 
School of Systems and Information Engineering http://turnbull.sk.tsukuba.ac.jp
University of Tsukuba                    Tennodai 1-1-1 Tsukuba 305-8573 JAPAN
               Ask not how you can "do" free software business;
              ask what your business can "do for" free software.




More information about the XEmacs-Beta mailing list