bug-texinfo
[Top][All Lists]
Advanced

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

Further info bug fixed


From: Gavin Smith
Subject: Further info bug fixed
Date: Wed, 8 Feb 2023 22:55:38 +0000

On Mon, Dec 12, 2022 at 06:47:44PM +0000, Gavin Smith wrote:
> On Mon, Dec 12, 2022 at 01:31:39PM +0100, Hilmar Preuße wrote:
> > Hello,
> > 
> > another one for you. The issue is reproducible with latest git checkout.
> > I could only test on amd64, where the error message looks differently.
> > 
> > hille@sid-amd64:~$ /usr/bin/info groff > /dev/null
> > realloc(): invalid next size
> > Aborted (core dumped)
> 
> Apologies for the further crash.  I believe I have fixed it in commit
> 9a83ffc3d.  I have also added the change to the release branch, and I
> think that we should make a bug-test release fairly soon with this fix
> in it (say, within a month).

I still didn't get it right.  This change stopped the crash but it
could lead to missing text in nodes.  The "Manipulating Hyphenation"
node in the groff manual only had 222 lines displayed, but it should
have had 323 lines.

So I've made a further change (at bottom of mail).

Looks like there may be a Texinfo 7.0.3 after all.


diff --git a/ChangeLog b/ChangeLog
index 16fd9a7d71..398c277e80 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2023-02-08  Gavin Smith <gavinsmith0123@gmail.com>
+
+       Stop text disappearing in Info nodes with encoding conversion
+
+       * info/util.c (text_buffer_iconv): Update text buffer length
+       after error so that we do not write over the same output again.
+
 2023-02-08  Gavin Smith <gavinsmith0123@gmail.com>
 
        Unify @multitable block line arg ending
diff --git a/info/util.c b/info/util.c
index 46af4ce385..bf02e36d13 100644
--- a/info/util.c
+++ b/info/util.c
@@ -357,6 +357,8 @@ text_buffer_iconv (struct text_buffer *buf, iconv_t 
iconv_state,
 
       iconv_ret = iconv (iconv_state, inbuf, inbytesleft,
                          &outptr, &out_bytes_left);
+      text_buffer_off (buf) = outptr - text_buffer_base (buf);
+
       if (iconv_ret != (size_t) -1)
         break; /* success */
 
@@ -366,7 +368,6 @@ text_buffer_iconv (struct text_buffer *buf, iconv_t 
iconv_state,
       else
         break; /* let calling code deal with it */
     }
-  text_buffer_off (buf) = outptr - text_buffer_base (buf);    
   return iconv_ret;
 }




reply via email to

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