aboutsummaryrefslogtreecommitdiff
path: root/stdlib/testmb.c
diff options
context:
space:
mode:
authorNoah Goldstein <goldstein.w.n@gmail.com>2022-06-22 08:24:21 -0700
committerNoah Goldstein <goldstein.w.n@gmail.com>2022-06-22 11:12:33 -0700
commit464d189b9622932a75302290625de84931656ec0 (patch)
tree86633be5a815b19d3e7f72d535dad1d13c6df328 /stdlib/testmb.c
parentdd06af4f81be9e6d6b5e3a72357a51fa7205d856 (diff)
downloadglibc-464d189b9622932a75302290625de84931656ec0.zip
glibc-464d189b9622932a75302290625de84931656ec0.tar.gz
glibc-464d189b9622932a75302290625de84931656ec0.tar.bz2
stdlib: Remove attr_write from mbstows if dst is NULL [BZ: 29265]
mbstows is defined if dst is NULL and is defined to special cased if dst is NULL so the fortify objsize check if incorrect in that case. Tested on x86-64 linux. Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
Diffstat (limited to 'stdlib/testmb.c')
-rw-r--r--stdlib/testmb.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/stdlib/testmb.c b/stdlib/testmb.c
index 45dae7d..6ac4dfd 100644
--- a/stdlib/testmb.c
+++ b/stdlib/testmb.c
@@ -16,6 +16,13 @@ main (int argc, char *argv[])
lose = 1;
}
+ i = mbstowcs (NULL, "bar", 4);
+ if (!(i == 3 && w[1] == 'a'))
+ {
+ puts ("mbstowcs FAILED2!");
+ lose = 1;
+ }
+
mbstowcs (w, "blah", 5);
i = wcstombs (c, w, 10);
if (i != 4)