[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
branch release/7.1 updated: * info/scan.c (write_tag_contents): Check if
From: |
Gavin D. Smith |
Subject: |
branch release/7.1 updated: * info/scan.c (write_tag_contents): Check if added text is of zero length in order to avoid subsequently calling memcpy with a null source argument. Report with -fsanitize=undefined on amd64 from Sam James <address@hidden>. |
Date: |
Sat, 04 Nov 2023 07:35:16 -0400 |
This is an automated email from the git hooks/post-receive script.
gavin pushed a commit to branch release/7.1
in repository texinfo.
The following commit(s) were added to refs/heads/release/7.1 by this push:
new 12ad80f3a1 * info/scan.c (write_tag_contents): Check if added text is
of zero length in order to avoid subsequently calling memcpy with a null source
argument. Report with -fsanitize=undefined on amd64 from Sam James
<sam@gentoo.org>.
12ad80f3a1 is described below
commit 12ad80f3a1cfa78c8a7b3a45458df7e07251317d
Author: Gavin Smith <gavinsmith0123@gmail.com>
AuthorDate: Sat Nov 4 10:38:48 2023 +0000
* info/scan.c (write_tag_contents): Check if added text is of
zero length in order to avoid subsequently calling memcpy with
a null source argument. Report with -fsanitize=undefined on amd64
from Sam James <sam@gentoo.org>.
---
ChangeLog | 7 +++++++
info/scan.c | 4 ++--
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 3d13a15517..efbb3b22d1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2023-11-04 Gavin Smith <gavinsmith0123@gmail.com>
+
+ * info/scan.c (write_tag_contents): Check if added text is of
+ zero length in order to avoid subsequently calling memcpy with
+ a null source argument. Report with -fsanitize=undefined on amd64
+ from Sam James <sam@gentoo.org>.
+
2023-10-25 Eli Zaretskii <eliz@gnu.org>
* tp/Texinfo/XS/xspara.c (xspara__add_next): Do not pass
diff --git a/info/scan.c b/info/scan.c
index d6183ae9ae..bdf272f9bf 100644
--- a/info/scan.c
+++ b/info/scan.c
@@ -925,11 +925,11 @@ write_extra_bytes_to_output (char *input, long n)
}
/* Like write_extra_bytes_to_output, but writes bytes even when
- preprocess_nodes=Off. */
+ preprocess_nodes=Off. Note n could be 0 for an index tag. */
static void
write_tag_contents (char *input, long n)
{
- if (rewrite_p)
+ if (rewrite_p && n > 0)
{
text_buffer_add_string (&output_buf, input, n);
output_bytes_difference -= n;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- branch release/7.1 updated: * info/scan.c (write_tag_contents): Check if added text is of zero length in order to avoid subsequently calling memcpy with a null source argument. Report with -fsanitize=undefined on amd64 from Sam James <address@hidden>.,
Gavin D. Smith <=