From: Paul Eggert Date: Tue, 31 May 2022 08:19:32 +0000 (-0700) Subject: Be more robust if doc file is corrupted X-Git-Tag: emacs-29.0.90~1910^2~319^2~2 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=569d4c7ad60ec84e69df02f74e0c013ff83b93c2;p=emacs.git Be more robust if doc file is corrupted * src/doc.c (Fsnarf_documentation): Don’t dump core on a corrupted doc file. Problem found by GCC 12 -Wanalyzer-null-argument. --- diff --git a/src/doc.c b/src/doc.c index 71e66853b08..14db3189f34 100644 --- a/src/doc.c +++ b/src/doc.c @@ -569,6 +569,8 @@ the same file name is found in the `doc-directory'. */) if (p) { end = strchr (p, '\n'); + if (!end) + error ("DOC file invalid at position %"pI"d", pos); /* We used to skip files not in build_files, so that when a function was defined several times in different files