From 5d2bf2c80f2fa0775393a9e3aefc933592db7c0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Trojnara?= Date: Mon, 4 Sep 2023 16:10:15 +0200 Subject: [PATCH] Fix insufficient MSI_ENTRY comparison --- msi.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/msi.c b/msi.c index 2347e74..f71d22f 100644 --- a/msi.c +++ b/msi.c @@ -1269,9 +1269,7 @@ static int msi_dirent_new(MSI_FILE *msi, MSI_ENTRY *entry, MSI_DIRENT *parent, M } /* detect cycles in previously visited entries (parents, siblings) */ if (!ret) { /* initialized (non-root entry) */ - if ((entry->leftSiblingID != NOSTREAM && tortoise->entry->leftSiblingID == entry->leftSiblingID) - || (entry->rightSiblingID != NOSTREAM && tortoise->entry->rightSiblingID == entry->rightSiblingID) - || (entry->childID != NOSTREAM && tortoise->entry->childID == entry->childID)) { + if (!memcmp(entry, tortoise->entry, sizeof(MSI_ENTRY))) { printf("MSI_ENTRY cycle detected at level %d\n", cnt); OPENSSL_free(entry); return 0; /* FAILED */