texinfo-commits
[Top][All Lists]
Advanced

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

branch master updated: * install-info/install-info.c (readfile): Do not


From: Gavin D. Smith
Subject: branch master updated: * install-info/install-info.c (readfile): Do not truncate input file at 8192 bytes. Report from Andreas Schwab.
Date: Wed, 13 Sep 2023 12:09:33 -0400

This is an automated email from the git hooks/post-receive script.

gavin pushed a commit to branch master
in repository texinfo.

The following commit(s) were added to refs/heads/master by this push:
     new 696a34988c * install-info/install-info.c (readfile): Do not truncate 
input file at 8192 bytes.  Report from Andreas Schwab.
696a34988c is described below

commit 696a34988c7a1ba531c9cbcd7b39c8a98f15cb3a
Author: Gavin Smith <gavinsmith0123@gmail.com>
AuthorDate: Wed Sep 13 17:09:15 2023 +0100

    * install-info/install-info.c (readfile): Do not truncate input
    file at 8192 bytes.  Report from Andreas Schwab.
---
 ChangeLog                   | 5 +++++
 install-info/install-info.c | 6 +++---
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index b6386e3e4e..76202ca072 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2023-09-13  Gavin Smith <gavinsmith0123@gmail.com>
+
+       * install-info/install-info.c (readfile): Do not truncate input
+       file at 8192 bytes.  Report from Andreas Schwab.
+
 2023-09-12  Gavin Smith <gavinsmith0123@gmail.com>
 
        * doc/texinfo.tex (\newlineloadsconf): Hook into definitions
diff --git a/install-info/install-info.c b/install-info/install-info.c
index a3c4e3c747..1dac9dc052 100644
--- a/install-info/install-info.c
+++ b/install-info/install-info.c
@@ -874,7 +874,7 @@ readfile (char *filename, int *sizep,
   FILE *f;
   int filled = 0;
   int data_size = 8192;
-  char *data = xmalloc (data_size);
+  char *data = xmalloc (data_size + 1);
 
   /* If they passed the space for the file name to return, use it.  */
   f = open_possibly_compressed_file (filename, create_callback,
@@ -893,10 +893,10 @@ readfile (char *filename, int *sizep,
         break;
 
       filled += nread;
-      if (filled == data_size - 1)
+      if (filled == data_size)
         {
           data_size += 65536;
-          data = xrealloc (data, data_size);
+          data = xrealloc (data, data_size + 1);
         }
     }
 



reply via email to

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