From a7f764cfe540493afb66d67a221f1849393e7abc Mon Sep 17 00:00:00 2001 From: Pip Cet Date: Sun, 26 Jan 2025 14:34:45 +0000 Subject: [PATCH] Avoid crashes in Fdocumentation caused by incorrect data types Note that this can only change things when function-documentation is defined or overloaded incorrectly. * src/doc.c (Fdocumentation): Check that the cdr of a docstring cons is a fixnum. (cherry picked from commit b07c12ce59c96db753a1f8f3a829f9ab5514e35f) --- src/doc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/doc.c b/src/doc.c index 6f4ce79f1f1..09e099efcdb 100644 --- a/src/doc.c +++ b/src/doc.c @@ -362,7 +362,7 @@ string is passed through `substitute-command-keys'. */) from the DOC file (bug in src/Makefile.in). */ if (BASE_EQ (doc, make_fixnum (0))) doc = Qnil; - if (FIXNUMP (doc) || CONSP (doc)) + if (FIXNUMP (doc) || (CONSP (doc) && FIXNUMP (XCDR (doc)))) { Lisp_Object tem = get_doc_string (doc, 0); if (NILP (tem) && try_reload) -- 2.39.5