The branch main has been updated by pstef:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=5a18515b3143792135881ce64e2380115c4744c1

commit 5a18515b3143792135881ce64e2380115c4744c1
Author:     Piotr Pawel Stefaniak <ps...@freebsd.org>
AuthorDate: 2021-04-01 05:31:03 +0000
Commit:     Piotr Pawel Stefaniak <ps...@freebsd.org>
CommitDate: 2021-04-01 05:31:03 +0000

    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;
 }
 
_______________________________________________
dev-commits-src-main@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/dev-commits-src-main
To unsubscribe, send any mail to "dev-commits-src-main-unsubscr...@freebsd.org"

Reply via email to