Commit c0e307b8 authored by Peter Korsgaard's avatar Peter Korsgaard
Browse files

sstrip: fix section length corruption bug

Based on openwrt #6847:

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



Signed-off-by: default avatarPeter Korsgaard <jacmet@sunsite.dk>
parent a67a62c2
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -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)); \
		} \
	} \
 \