mirror of
https://github.com/openharmony/third_party_mksh.git
synced 2026-07-18 18:04:47 -04:00
!68 fix exec crash
Merge pull request !68 from 张吉东/fix_exec_release_503
This commit is contained in:
@@ -244,6 +244,9 @@ if (defined(ohos_lite)) {
|
||||
"-DMKSH_UNLIMITED",
|
||||
"-DMKSH_BUILD_R=593",
|
||||
]
|
||||
|
||||
defines = [ "MKSH_OH_ADAPT" ]
|
||||
|
||||
ldflags = [
|
||||
"-pie",
|
||||
"-Wl,-z,relro",
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user