From 5a18515b3143792135881ce64e2380115c4744c1 Mon Sep 17 00:00:00 2001 From: Piotr Pawel Stefaniak Date: Thu, 1 Apr 2021 07:31:03 +0200 Subject: [PATCH] sh: silence sanitizer Don't add 0 to a null pointer. Reviewed by: jilles --- bin/sh/memalloc.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bin/sh/memalloc.c b/bin/sh/memalloc.c index a2191771386d..7ea31af050e5 100644 --- a/bin/sh/memalloc.c +++ b/bin/sh/memalloc.c @@ -227,7 +227,10 @@ popstackmark(struct stackmark *mark) } stacknxt = mark->stacknxt; stacknleft = mark->stacknleft; - sstrend = stacknxt + stacknleft; + if (stacknleft != 0) + sstrend = stacknxt + stacknleft; + else + sstrend = stacknxt; INTON; }