git: fa6fa98ac712 - main - sh(1): initialize smark to zero in main()
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sat, 03 Jun 2023 21:10:19 UTC
The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=fa6fa98ac712e48fe8e9bca1295b1c54cf744724 commit fa6fa98ac712e48fe8e9bca1295b1c54cf744724 Author: Daniel Kolesa <q66@chimera-linux.org> AuthorDate: 2023-06-03 21:08:56 +0000 Commit: Baptiste Daroussin <bapt@FreeBSD.org> CommitDate: 2023-06-03 21:09:31 +0000 sh(1): initialize smark to zero in main() As popstackmark may be called on this without pushstackmark having been called, we need to initialize it so that we don't get a bogus comparison inside popstackmark, which would have resulted in a NULL pointer dereference. MFC After: 3 days Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D40413 --- bin/sh/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/sh/main.c b/bin/sh/main.c index bc87440807b2..a77f9528064d 100644 --- a/bin/sh/main.c +++ b/bin/sh/main.c @@ -100,7 +100,7 @@ static char *find_dot_file(char *); int main(int argc, char *argv[]) { - struct stackmark smark, smark2; + struct stackmark smark = {0}, smark2; volatile int state; char *shinit;