GP-702: Fixed an exception that occurred when importing Mach-O files

that define zero LC_BUILD_VERSION tool entries
This commit is contained in:
Ryan Kurtz
2021-02-22 11:40:32 -05:00
parent efa065ac4d
commit 7868dbc4f9

View File

@@ -80,8 +80,10 @@ public class BuildVersionCommand extends LoadCommand {
struct.add(DWORD, "minos", null);
struct.add(DWORD, "sdk", null);
struct.add(DWORD, "ntools", null);
struct.add(new ArrayDataType(buildToolVersionDataType, ntools,
buildToolVersionDataType.getLength()), "build_tool_version[]", null);
if (ntools > 0) {
struct.add(new ArrayDataType(buildToolVersionDataType, ntools,
buildToolVersionDataType.getLength()), "build_tool_version[]", null);
}
struct.setCategoryPath(new CategoryPath(MachConstants.DATA_TYPE_CATEGORY));
return struct;
}