summaryrefslogtreecommitdiff
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
commitb321fe82d325064f971a6dcda21696a4d82ba396 (patch)
tree68e8a2bb546ffb3d00881c28cef66d502be31998 /tools/sstrip
parenta27a5a197319ff6d9282029a20e4ed130947683c (diff)
downloadmtk-20170518-b321fe82d325064f971a6dcda21696a4d82ba396.zip
mtk-20170518-b321fe82d325064f971a6dcda21696a4d82ba396.tar.gz
mtk-20170518-b321fe82d325064f971a6dcda21696a4d82ba396.tar.bz2
sstrip: fix a section length corruption bug (patch from #6847)
SVN-Revision: 20154
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 6607d12..0508aaa 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)); \
} \
} \
\