]> git.eshelyaron.com Git - emacs.git/commitdiff
Be more robust if doc file is corrupted
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 31 May 2022 08:19:32 +0000 (01:19 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 31 May 2022 08:26:47 +0000 (01:26 -0700)
* src/doc.c (Fsnarf_documentation): Don’t dump core on a corrupted
doc file.  Problem found by GCC 12 -Wanalyzer-null-argument.

src/doc.c

index 71e66853b088b1df77b578da6130f85d4a4ba9e5..14db3189f34c2fff9659ccecfd88a65ea93a3923 100644 (file)
--- 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