Skip to content

Commit

Permalink
Don't crash on older code directory versions
Browse files Browse the repository at this point in the history
Team ID wasn't added until 0x20200, so check that to make sure it's
available first.
  • Loading branch information
CRKatri committed Dec 14, 2023
1 parent 8cee816 commit 52048d9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ldid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3903,7 +3903,7 @@ int main(int argc, char *argv[]) {
PKCS7_free(p7);
}

if (Swap(directory->teamIDOffset) > 0)
if (Swap(directory->version) >= 0x20200 && Swap(directory->teamIDOffset) > 0)
printf("TeamIdentifier=%s\n", blob + best->second.offset + Swap(directory->teamIDOffset));
else
printf("TeamIdentifier=not set\n");
Expand Down

0 comments on commit 52048d9

Please sign in to comment.