emacs-diffs
[Top][All Lists]
Advanced

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

master 569d4c7ad6 09/11: Be more robust if doc file is corrupted


From: Paul Eggert
Subject: master 569d4c7ad6 09/11: Be more robust if doc file is corrupted
Date: Tue, 31 May 2022 04:27:01 -0400 (EDT)

branch: master
commit 569d4c7ad60ec84e69df02f74e0c013ff83b93c2
Author: Paul Eggert <eggert@cs.ucla.edu>
Commit: Paul Eggert <eggert@cs.ucla.edu>

    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.
---
 src/doc.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/doc.c b/src/doc.c
index 71e66853b0..14db3189f3 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



reply via email to

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