bug-groff
[Top][All Lists]
Advanced

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

[bug #64879] [PATCH] [libbib] fix bogus size diagnostic


From: G. Branden Robinson
Subject: [bug #64879] [PATCH] [libbib] fix bogus size diagnostic
Date: Fri, 10 Nov 2023 00:55:35 -0500 (EST)

URL:
  <https://savannah.gnu.org/bugs/?64879>

                 Summary: [PATCH] [libbib] fix bogus size diagnostic
                   Group: GNU roff
               Submitter: gbranden
               Submitted: Fri 10 Nov 2023 05:55:32 AM UTC
                Category: Preprocessor refer
                Severity: 3 - Normal
              Item Group: Warning/Suspicious behaviour
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
         Planned Release: None


    _______________________________________________________

Follow-up Comments:


-------------------------------------------------------
Date: Fri 10 Nov 2023 05:55:32 AM UTC By: G. Branden Robinson <gbranden>
Paul Eggert
[https://lists.gnu.org/archive/html/bug-groff/2023-11/msg00018.html reported
this issue to the bug-groff list].

Thanks for the report and patch, Paul!


* src/libs/libbib/index.cpp (index_search_item::check_header)
Fix size calculation typo that generated bogus diagnostic
"lookbib: error: corrupt header in index file".
---
 ChangeLog                 | 7 +++++++
 src/libs/libbib/index.cpp | 2 +-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index dc2465fa0..834a0cb2c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2023-11-09  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Fix indxbib bogus size diagnostic
+       * src/libs/libbib/index.cpp (index_search_item::check_header)
+       Fix size calculation typo that generated bogus diagnostic
+       "lookbib: error: corrupt header in index file".
+
 2023-11-06  Pim <pimh@kth.se>
 
        * src/preproc/eqn/lex.cpp: Update internal macro definitions
diff --git a/src/libs/libbib/index.cpp b/src/libs/libbib/index.cpp
index 0664746ae..18701a157 100644
--- a/src/libs/libbib/index.cpp
+++ b/src/libs/libbib/index.cpp
@@ -163,7 +163,7 @@ const char *index_search_item::check_header(index_header 
*file_header,
               + file_header->lists_size * sizeof(int)
               + file_header->table_size * sizeof(int)
               + file_header->strings_size
-              + sizeof(file_header));
+              + sizeof *file_header);
   if (sz != file_size)
     return("size mismatch between header and data");
   unsigned size_remaining = file_size;
-- 
2.41.0









    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?64879>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/




reply via email to

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