add only a non-stream child to the tree

This commit is contained in:
olszomal 2022-02-22 15:28:34 +01:00 committed by Michał Trojnara
parent 7b12abf21f
commit d471b51db5

3
msi.c
View File

@ -470,7 +470,8 @@ int msi_dirent_new(MSI_FILE *msi, MSI_ENTRY *entry, MSI_DIRENT *parent, MSI_DIRE
if (!recurse_entry(msi, entry->leftSiblingID, parent, dirent) if (!recurse_entry(msi, entry->leftSiblingID, parent, dirent)
|| !recurse_entry(msi, entry->rightSiblingID, parent, dirent) || !recurse_entry(msi, entry->rightSiblingID, parent, dirent)
|| !recurse_entry(msi, entry->childID, dirent, dirent)) { || (entry->type != DIR_STREAM && !recurse_entry(msi, entry->childID, dirent, dirent))) {
printf("Failed to add a sibling or a child to the tree\n");
sk_MSI_DIRENT_free(dirent->children); sk_MSI_DIRENT_free(dirent->children);
OPENSSL_free(dirent); OPENSSL_free(dirent);
return 0; /* FAILED */ return 0; /* FAILED */