From 20308176afd5a82461c1faa72b882bc612ba273b Mon Sep 17 00:00:00 2001 From: zhangjidong Date: Wed, 26 Feb 2025 14:08:25 +0800 Subject: [PATCH] fix exec crash Signed-off-by: zhangjidong --- exec.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/exec.c b/exec.c index 3d35db5..06a0048 100644 --- a/exec.c +++ b/exec.c @@ -1167,6 +1167,12 @@ builtin(const char *name, int (*func) (const char **)) struct tbl * findcom(const char *name, int flags) { +#ifdef MKSH_OH_ADAPT + // fix crash for 'exec -a0' + if (name == NULL) { + return NULL; + } +#endif static struct tbl temp; uint32_t h = hash(name); struct tbl *tp = NULL, *tbi;