public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc/arm/morello/main] Fix off-by-one error in iconv/tst-iconv-mt
@ 2022-10-12 14:15 Szabolcs Nagy
  0 siblings, 0 replies; 2+ messages in thread
From: Szabolcs Nagy @ 2022-10-12 14:15 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=00f9cd1a70c35304b4fb4b6dbcdf2f78228c912b

commit 00f9cd1a70c35304b4fb4b6dbcdf2f78228c912b
Author: Szabolcs Nagy <szabolcs.nagy@arm.com>
Date:   Mon Sep 26 15:38:19 2022 +0100

    Fix off-by-one error in iconv/tst-iconv-mt
    
    The iconv buffer sizes must not include the \0 string terminator.
    (When \0 cannot be part of a valid character encoding glibc iconv
    would copy it to the output as expected, but then later the explicit
    output termination with *outbufpos = '\0' is out of bounds.)

Diff:
---
 iconv/tst-iconv-mt.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/iconv/tst-iconv-mt.c b/iconv/tst-iconv-mt.c
index daaebd273b..0320885c06 100644
--- a/iconv/tst-iconv-mt.c
+++ b/iconv/tst-iconv-mt.c
@@ -58,11 +58,11 @@ worker (void * arg)
 
   char ascii[] = CONV_INPUT;
   char *inbufpos = ascii;
-  size_t inbytesleft = sizeof (CONV_INPUT);
+  size_t inbytesleft = sizeof (CONV_INPUT) - 1;
 
   char *utf8 = xcalloc (sizeof (CONV_INPUT), 1);
   char *outbufpos = utf8;
-  size_t outbytesleft = sizeof (CONV_INPUT);
+  size_t outbytesleft = sizeof (CONV_INPUT) - 1;
 
   if (tidx < TCOUNT/2)
     /* The first half of the worker thread pool synchronize together here,

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [glibc/arm/morello/main] Fix off-by-one error in iconv/tst-iconv-mt
@ 2022-10-26 15:10 Szabolcs Nagy
  0 siblings, 0 replies; 2+ messages in thread
From: Szabolcs Nagy @ 2022-10-26 15:10 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=0dd9d433dd170c0d743cde38aa18689c7a794618

commit 0dd9d433dd170c0d743cde38aa18689c7a794618
Author: Szabolcs Nagy <szabolcs.nagy@arm.com>
Date:   Mon Sep 26 15:38:19 2022 +0100

    Fix off-by-one error in iconv/tst-iconv-mt
    
    The iconv buffer sizes must not include the \0 string terminator.
    (When \0 cannot be part of a valid character encoding glibc iconv
    would copy it to the output as expected, but then later the explicit
    output termination with *outbufpos = '\0' is out of bounds.)

Diff:
---
 iconv/tst-iconv-mt.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/iconv/tst-iconv-mt.c b/iconv/tst-iconv-mt.c
index daaebd273b..0320885c06 100644
--- a/iconv/tst-iconv-mt.c
+++ b/iconv/tst-iconv-mt.c
@@ -58,11 +58,11 @@ worker (void * arg)
 
   char ascii[] = CONV_INPUT;
   char *inbufpos = ascii;
-  size_t inbytesleft = sizeof (CONV_INPUT);
+  size_t inbytesleft = sizeof (CONV_INPUT) - 1;
 
   char *utf8 = xcalloc (sizeof (CONV_INPUT), 1);
   char *outbufpos = utf8;
-  size_t outbytesleft = sizeof (CONV_INPUT);
+  size_t outbytesleft = sizeof (CONV_INPUT) - 1;
 
   if (tidx < TCOUNT/2)
     /* The first half of the worker thread pool synchronize together here,

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-10-26 15:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-12 14:15 [glibc/arm/morello/main] Fix off-by-one error in iconv/tst-iconv-mt Szabolcs Nagy
2022-10-26 15:10 Szabolcs Nagy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).