Skip to content
Permalink
Browse files Browse the repository at this point in the history
Merge pull request #487 from chibataiki/devel
Complain when Mach_header.sizeofcmds == 0

#487
  • Loading branch information
jreiser committed Apr 10, 2021
2 parents 04c2293 + a94c7b3 commit 28e761c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/p_mach.cpp
Expand Up @@ -1552,6 +1552,9 @@ int PackMachBase<T>::canUnpack()
if (2048 < headway) {
infoWarning("Mach_header.sizeofcmds(%d) > 2048", headway);
}
if(!headway){
throwCantPack("Mach_header.sizeofcmds == 0");
}
rawmseg_buf.alloc(mhdri.sizeofcmds);
rawmseg = (Mach_segment_command *)rawmseg_buf.getVoidPtr();
fi->readx(rawmseg, mhdri.sizeofcmds);
Expand Down

0 comments on commit 28e761c

Please sign in to comment.