summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2023-11-10 03:54:27 +0000
committerGravatar Nikias Bassen2023-12-11 12:28:23 +0100
commit202e8ec125af87c5bfa1d4ee401a42bc37f9d159 (patch)
treec090eb19ee38935bcae50c1fd68103d0bf9451f7
parent6096480407bcb8e6e74389f8a6780c1056a0aaf3 (diff)
downloadlibimobiledevice-glue-202e8ec125af87c5bfa1d4ee401a42bc37f9d159.tar.gz
libimobiledevice-glue-202e8ec125af87c5bfa1d4ee401a42bc37f9d159.tar.bz2
opack: Fix parsing of 32 and 64 bit packed values
32 and 64 bit packed values were not parsed correctly due to bad pointer manipulation. Thanks to @cornejo for spotting this!
-rw-r--r--src/opack.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/opack.c b/src/opack.c
index 8892c26..9c4ba55 100644
--- a/src/opack.c
+++ b/src/opack.c
@@ -304,11 +304,11 @@ static int opack_decode_obj(unsigned char** p, unsigned char* end, plist_t* plis
} else if (type == 0x32) {
uint32_t u32val = *(uint32_t*)*p;
value = (int32_t)le32toh(u32val);
- (p)+=4;
+ (*p)+=4;
} else if (type == 0x33) {
uint64_t u64val = *(uint64_t*)*p;
value = le64toh(u64val);
- (p)+=8;
+ (*p)+=8;
} else {
fprintf(stderr, "%s: ERROR: Invalid encoded byte '%02x'\n", __func__, type);
*p = end;