diff options
author | ngie <ngie@FreeBSD.org> | 2017-02-10 02:48:24 +0000 |
---|---|---|
committer | ngie <ngie@FreeBSD.org> | 2017-02-10 02:48:24 +0000 |
commit | a85eb86e22c2d20e7f2d81da683666595f6ad7f0 (patch) | |
tree | dc13ae7a0499e34ddc8ef68def08591cefaf0baa /contrib/netbsd-tests/lib/libc | |
parent | a7c475189eb5f7c2369405426243eefe9e1ba7c1 (diff) | |
download | FreeBSD-src-a85eb86e22c2d20e7f2d81da683666595f6ad7f0.zip FreeBSD-src-a85eb86e22c2d20e7f2d81da683666595f6ad7f0.tar.gz |
MFC r306784:
r306784 (by emaste):
Add test for a musl libc memmem bug
With a short needle (aka little) musl's memmem could read past the end
of the haystack (aka big). This was fixed in musl commit c718f9f.
Diffstat (limited to 'contrib/netbsd-tests/lib/libc')
-rw-r--r-- | contrib/netbsd-tests/lib/libc/string/t_memmem.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/contrib/netbsd-tests/lib/libc/string/t_memmem.c b/contrib/netbsd-tests/lib/libc/string/t_memmem.c index 5807662..c11b698 100644 --- a/contrib/netbsd-tests/lib/libc/string/t_memmem.c +++ b/contrib/netbsd-tests/lib/libc/string/t_memmem.c @@ -51,6 +51,8 @@ char p6[] = "9"; int lp6 = 1; char p7[] = "654"; int lp7 = 3; +char p8[] = "89abc"; +int lp8 = 5; char b0[] = ""; int lb0 = 0; @@ -94,6 +96,7 @@ ATF_TC_BODY(memmem_basic, tc) expect(memmem(b2, lb2, p4, lp4) == NULL); expect(memmem(b2, lb2, p7, lp7) == NULL); + expect(memmem(b2, lb2, p8, lp8) == NULL); } ATF_TP_ADD_TCS(tp) |