From 4c259c9e1edbf31b1a02fa401cd4a2b4d9032d66 Mon Sep 17 00:00:00 2001 From: Fabian Mauchle Date: Mon, 15 Jul 2019 08:10:15 +0200 Subject: [PATCH] fix stack smashing in test script --- tests/t_rewrite.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/t_rewrite.c b/tests/t_rewrite.c index 6793be8..bbbe469 100644 --- a/tests/t_rewrite.c +++ b/tests/t_rewrite.c @@ -412,10 +412,10 @@ main (int argc, char *argv[]) struct modattr *mod = malloc(sizeof(struct modattr)); regex_t regex; - for (i=0; i<253; i+=20){ + for (i=0; i<253-20; i+=20){ memcpy(value2+i, value, 20); } - memcpy(value2+i-20, "and another13\0", 14); + memcpy(value2+i, "and another13\0", 14); mod->t = 1; mod->regex = ®ex;