[PATCH] ash: fix here strings causing segfault in function invocation
Ron Yorston via busybox <[email protected]>
| Newsgroups | gmane.linux.busybox |
|---|---|
| Message-ID | <69a849ec.41N4MtUdE3gGW+52%[email protected]> |
The size of the NFROMSTR struct wasn't initialised in the nodesize
array, so we got:
$ ./busybox sh
$ f() { cat <<< hello; }
$ f
Segmentation fault (core dumped) ./busybox sh
Signed-off-by: Ron Yorston <[email protected]>
---
shell/ash.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/shell/ash.c b/shell/ash.c
index 19623a9a0..1f5b467ec 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -9300,6 +9300,7 @@ static const uint8_t nodesize[N_NUMBER] ALIGN1 = {
#endif
[NCLOBBER ] = SHELL_ALIGN(sizeof(struct nfile)),
[NFROM ] = SHELL_ALIGN(sizeof(struct nfile)),
+ [NFROMSTR ] = SHELL_ALIGN(sizeof(struct nfile)),
[NFROMTO ] = SHELL_ALIGN(sizeof(struct nfile)),
[NAPPEND ] = SHELL_ALIGN(sizeof(struct nfile)),
[NTOFD ] = SHELL_ALIGN(sizeof(struct ndup)),
--
2.53.0