bug-gnulib
[Top][All Lists]
Advanced

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

[PATCH] printf_parse: fix off-by-two


From: Johannes Schindelin
Subject: [PATCH] printf_parse: fix off-by-two
Date: Sat, 11 Nov 2023 22:53:33 +0100 (CET)

In 480a59ba60 (*printf-posix: ISO C 23: Support size specifiers 'wN' and
'wfN'., 2023-03-24), a major refactoring hides a bug in the conversion
of the code handling Windows' `%I64*` family of `printf()` formats:
before the refactoring, the `64` part was skipped (as desired), but
afterwards that part is not skipped and therefore the `6` is mistaken
for a conversion character. Which is invalid, of course, causing the
code to error out.

Fix this by skipping the `64` part again.

This bug was uncovered by the Git for Windows project when `gettext`
v0.22.3 switched to the gnulib code as work horse of the
`libintl_vsnprintf()` function.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
Published-As: 
https://github.com/dscho/gnulib/releases/tag/fix-printf-I64-regression-v1
Fetch-It-Via: git fetch https://github.com/dscho/gnulib 
fix-printf-I64-regression-v1

 lib/printf-parse.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/printf-parse.c b/lib/printf-parse.c
index d3f2c3cb5d..6741ee5ff4 100644
--- a/lib/printf-parse.c
+++ b/lib/printf-parse.c
@@ -555,7 +555,7 @@ PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, 
arguments *a)
                     unsigned_type = TYPE_ULONGINT;
                     pointer_type = TYPE_COUNT_LONGINT_POINTER;
                   }
-                cp++;
+                cp += 3;
               }
 #endif


base-commit: 5c8fc31ab5db3372739a7ae9bf579cef946408ad
--
2.43.0.rc1.windows.1



reply via email to

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