Skip to content

Commit

Permalink
opack: Fix parsing of 32 and 64 bit packed values
Browse files Browse the repository at this point in the history
32 and 64 bit packed values were not parsed correctly due to bad pointer manipulation.
Thanks to @cornejo for spotting this!
  • Loading branch information
nikias committed Dec 11, 2023
1 parent 6096480 commit 202e8ec
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/opack.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 202e8ec

Please sign in to comment.