summaryrefslogtreecommitdiff
path: root/regress/lib
diff options
context:
space:
mode:
authorOtto Moerbeek <otto@cvs.openbsd.org>2023-10-22 12:20:08 +0000
committerOtto Moerbeek <otto@cvs.openbsd.org>2023-10-22 12:20:08 +0000
commit11be2b9bd18fb948cef81b9c2de00dbc8acf6b2e (patch)
tree299494f69a8d2b0db5774451d69b7bcf1fcbfc1a /regress/lib
parentebfcf4b057d905c1dac42bab27a0b3e0617d7430 (diff)
A few more tests
Diffstat (limited to 'regress/lib')
-rw-r--r--regress/lib/libc/malloc/malloc_errs/malloc_errs.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/regress/lib/libc/malloc/malloc_errs/malloc_errs.c b/regress/lib/libc/malloc/malloc_errs/malloc_errs.c
index 6040590a65d..c711980861a 100644
--- a/regress/lib/libc/malloc/malloc_errs/malloc_errs.c
+++ b/regress/lib/libc/malloc/malloc_errs/malloc_errs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: malloc_errs.c,v 1.3 2023/06/04 06:58:33 otto Exp $ */
+/* $OpenBSD: malloc_errs.c,v 1.4 2023/10/22 12:20:07 otto Exp $ */
/*
* Copyright (c) 2023 Otto Moerbeek <otto@drijf.net>
*
@@ -226,6 +226,17 @@ t20(void)
free(p);
}
+/* out-of-bound write preceding chunk */
+void
+t22(void)
+{
+ int i, j;
+ unsigned char *p = malloc(32);
+ p[32] = 0;
+ for (i = 0; i < 10000; i++)
+ p = malloc(32);
+}
+
struct test {
void (*test)(void);
const char *flags;
@@ -253,6 +264,9 @@ struct test tests[] = {
{ t18, "" },
{ t19, "" },
{ t20, "C" },
+ { t8, "FJD" }, /* t21 re-uses code from t8 */
+ { t22, "J" },
+ { t22, "JD" }, /* t23 re-uses code from t22 */
};
int main(int argc, char *argv[])