From d233810051bb7f5edd0d5239f8fb5b25b7b69dd1 Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Sat, 16 May 2015 20:09:04 +0100 Subject: [PATCH] setbrk: possible paranoia for the moment ensure our new sbrk space is clean --- Applications/V7/cmd/sh/setbrk.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Applications/V7/cmd/sh/setbrk.c b/Applications/V7/cmd/sh/setbrk.c index 618edf73..fe1b31a7 100644 --- a/Applications/V7/cmd/sh/setbrk.c +++ b/Applications/V7/cmd/sh/setbrk.c @@ -10,10 +10,13 @@ */ #include "defs.h" +#include void *setbrk(intptr_t incr) { uint8_t *a = sbrk(incr); brkend = a + incr; + if (a != (uint8_t *)-1) + memset(a, 0, incr); return a; } -- 2.34.1