aboutsummaryrefslogtreecommitdiffstats
path: root/tools/sstrip
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2010-03-12 00:35:36 +0000
committerFelix Fietkau <nbd@openwrt.org>2010-03-12 00:35:36 +0000
commitff7379f7e80769851d584d3fa01dea374f65dea6 (patch)
treed22357df0b84e670ec14650d59aac5eba823c4b8 /tools/sstrip
parenta41795aae699e00cdafb9d1912f7e94667f373bd (diff)
downloadupstream-ff7379f7e80769851d584d3fa01dea374f65dea6.tar.gz
upstream-ff7379f7e80769851d584d3fa01dea374f65dea6.tar.bz2
upstream-ff7379f7e80769851d584d3fa01dea374f65dea6.zip
sstrip: fix a section length corruption bug (patch from #6847)
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@20154 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'tools/sstrip')
-rw-r--r--tools/sstrip/src/sstrip.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/tools/sstrip/src/sstrip.c b/tools/sstrip/src/sstrip.c
index 6607d12500..0508aaac81 100644
--- a/tools/sstrip/src/sstrip.c
+++ b/tools/sstrip/src/sstrip.c
@@ -251,8 +251,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)); \
} \
} \
\