gawk-diffs
[Top][All Lists]
Advanced

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

[SCM] gawk branch, gawk-5.3-stable, updated. gawk-4.1.0-5512-g81d8fb04


From: Arnold Robbins
Subject: [SCM] gawk branch, gawk-5.3-stable, updated. gawk-4.1.0-5512-g81d8fb04
Date: Fri, 16 Aug 2024 09:42:35 -0400 (EDT)

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "gawk".

The branch, gawk-5.3-stable has been updated
       via  81d8fb04d93026a5b933439db964e1251bbeab68 (commit)
      from  7e870b2ead2fa1f1fa25219e24375b6bc0e4fe7d (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=81d8fb04d93026a5b933439db964e1251bbeab68

commit 81d8fb04d93026a5b933439db964e1251bbeab68
Author: Arnold D. Robbins <arnold@skeeve.com>
Date:   Fri Aug 16 16:42:16 2024 +0300

    Small bug fix in printf.c.

diff --git a/ChangeLog b/ChangeLog
index e21de4ab..538418fe 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2024-08-16         Arnold D. Robbins     <arnold@skeeve.com>
+
+       * printf.c (zero_fill_to_precision): Fix calculation of buflen.
+       Thanks and a tip of the hatlo to Address Sanitizer.
+
 2024-08-12         Arnold D. Robbins     <arnold@skeeve.com>
 
        * awkgram.y (push_ns_onto_namespace_chain): New function.
diff --git a/printf.c b/printf.c
index be03507a..2410fde5 100644
--- a/printf.c
+++ b/printf.c
@@ -1818,7 +1818,8 @@ zero_fill_to_precision(char *number_value, struct flags 
*flags)
        int prec = flags->precision;
        size_t val_len = strlen(number_value);
 
-       buflen = flags->precision + 1;  // we know val_len < precision
+       buflen = (flags->negative || flags->plus || flags->space) +
+                       flags->precision + 1;   // we know val_len < precision
 
        emalloc(buf1, char *, buflen, "zero_fill_to_precision");
        cp = buf1;

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog | 5 +++++
 printf.c  | 3 ++-
 2 files changed, 7 insertions(+), 1 deletion(-)


hooks/post-receive
-- 
gawk



reply via email to

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