diff options
| -rw-r--r-- | ldso/util/ldd.c | 5 | 
1 files changed, 3 insertions, 2 deletions
diff --git a/ldso/util/ldd.c b/ldso/util/ldd.c index b7a8dfe3a..9be97cce0 100644 --- a/ldso/util/ldd.c +++ b/ldso/util/ldd.c @@ -535,7 +535,8 @@ foo:  	interp = find_elf_interpreter(ehdr);  #ifdef __LDSO_LDD_SUPPORT -	if (interp && ehdr->e_ident[EI_CLASS] == ELFCLASSM && ehdr->e_ident[EI_DATA] == ELFDATAM +	if (interp && ehdr->e_type == ET_EXEC && ehdr->e_ident[EI_CLASS] == ELFCLASSM &&  +			ehdr->e_ident[EI_DATA] == ELFDATAM  		&& ehdr->e_ident[EI_VERSION] == EV_CURRENT && MATCH_MACHINE(ehdr->e_machine))   	{  		struct stat statbuf; @@ -558,7 +559,7 @@ foo:  			/* Wait till it returns */  			waitpid(pid, &status, 0); -			if (WIFEXITED(status)!=0xdead) { +			if (WIFEXITED(status) && WEXITSTATUS(status)==0) {  				return 1;  			}  | 
