Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 6 Oct 2016 20:27:40 +0000 (UTC)
From:      Ed Maste <emaste@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r306784 - head/contrib/netbsd-tests/lib/libc/string
Message-ID:  <201610062027.u96KReDk058467@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: emaste
Date: Thu Oct  6 20:27:40 2016
New Revision: 306784
URL: https://svnweb.freebsd.org/changeset/base/306784

Log:
  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.
  
  Reviewed by:	ed
  Sponsored by:	The FreeBSD Foundation
  Differential Revision:	https://reviews.freebsd.org/D8137

Modified:
  head/contrib/netbsd-tests/lib/libc/string/t_memmem.c

Modified: head/contrib/netbsd-tests/lib/libc/string/t_memmem.c
==============================================================================
--- head/contrib/netbsd-tests/lib/libc/string/t_memmem.c	Thu Oct  6 19:51:30 2016	(r306783)
+++ head/contrib/netbsd-tests/lib/libc/string/t_memmem.c	Thu Oct  6 20:27:40 2016	(r306784)
@@ -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)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201610062027.u96KReDk058467>