sstrip: fix section length corruption bug

Based on openwrt #6847:

https://dev.openwrt.org/ticket/6847

Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
This commit is contained in:
Peter Korsgaard 2010-07-13 13:10:39 +02:00
parent a67a62c296
commit c0e307b848

View File

@ -253,8 +253,7 @@ static int modifyheaders ## CLASS (Elf ## CLASS ## _Ehdr *ehdr, \
ESET(phdr->p_offset,newsize); \
ESET(phdr->p_filesz,0); \
} else if (EGET(phdr->p_offset) + EGET(phdr->p_filesz) > newsize) { \
newsize -= EGET(phdr->p_offset); \
ESET(phdr->p_filesz, newsize); \
ESET(phdr->p_filesz, newsize - EGET(phdr->p_offset)); \
} \
} \
\