diff options
author | Piotr Pawel Stefaniak <pstef@FreeBSD.org> | 2021-04-01 05:31:03 +0000 |
---|---|---|
committer | Piotr Pawel Stefaniak <pstef@FreeBSD.org> | 2021-04-01 05:31:03 +0000 |
commit | 5a18515b3143792135881ce64e2380115c4744c1 (patch) | |
tree | 178a2c109fb1b8c8ea00360a6f535f7355d56e05 | |
parent | 556e66b7b0763d36ddf5af98d06a1a13090bb729 (diff) | |
download | src-5a18515b3143792135881ce64e2380115c4744c1.tar.gz src-5a18515b3143792135881ce64e2380115c4744c1.zip |
sh: silence sanitizer
Don't add 0 to a null pointer.
Reviewed by: jilles
-rw-r--r-- | bin/sh/memalloc.c | 5 |
1 files changed, 4 insertions, 1 deletions
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; } |