Fix section_size_inflated parsing.

This commit is contained in:
orboditilt 2019-02-25 12:12:57 +01:00
parent b7fc04ce27
commit 65918d9174
3 changed files with 5 additions and 6 deletions

View File

@ -5,7 +5,7 @@
<groupId>de.orb</groupId> <groupId>de.orb</groupId>
<artifactId>rpxparser</artifactId> <artifactId>rpxparser</artifactId>
<version>0.0.1-SNAPSHOT</version> <version>0.0.2-SNAPSHOT</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<name>rpxparser</name> <name>rpxparser</name>
@ -19,7 +19,7 @@
<dependency> <dependency>
<groupId>org.projectlombok</groupId> <groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId> <artifactId>lombok</artifactId>
<version>1.18.4</version> <version>1.18.6</version>
</dependency> </dependency>
</dependencies> </dependencies>

View File

@ -140,8 +140,7 @@ public class ElfSection {
buf.get(data, 0, (int) orgSize); buf.get(data, 0, (int) orgSize);
if ((flags & RPX_SHDR_ZLIB_FLAG) == RPX_SHDR_ZLIB_FLAG) { if ((flags & RPX_SHDR_ZLIB_FLAG) == RPX_SHDR_ZLIB_FLAG) {
long section_size_inflated = buf.getInt(0) & 0xFFFFFFFF; long section_size_inflated = buf.getInt((int) offset) & 0xFFFFFFFF;
Inflater inflater = new Inflater(); Inflater inflater = new Inflater();
inflater.setInput(data, 4, (int) orgSize - 4); // the first byte is the size inflater.setInput(data, 4, (int) orgSize - 4); // the first byte is the size