fix exec crash

Signed-off-by: zhangjidong <zhangjidong8@huawei.com>
This commit is contained in:
zhangjidong
2025-02-26 14:08:25 +08:00
parent 9246398847
commit 20308176af
+6
View File
@@ -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;