From f783b3b045062481c8c231311c92143242627cd7 Mon Sep 17 00:00:00 2001 From: mdb_services2 Date: Sun, 20 Oct 2024 06:36:01 -0700 Subject: [PATCH] Correct HACK logic for Stat/Transfer --- src/sas/readstat_sas7bdat_read.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/sas/readstat_sas7bdat_read.c b/src/sas/readstat_sas7bdat_read.c index 1a745a7..05a00ed 100644 --- a/src/sas/readstat_sas7bdat_read.c +++ b/src/sas/readstat_sas7bdat_read.c @@ -979,12 +979,11 @@ static readstat_error_t sas7bdat_parse_page_pass2(const char *page, size_t page_ if ((page_type & SAS_PAGE_TYPE_MASK) == SAS_PAGE_TYPE_MIX) { /* HACK - this is supposed to obey 8-byte boundaries but * some files created by Stat/Transfer don't. So verify that the - * padding is { 0, 0, 0, 0 } or { ' ', ' ', ' ', ' ' } (or that + * padding is { 0, 0, 0, 0 } or { ' ', ' ', ' ', ' ' } (and that * the file is not from Stat/Transfer) before skipping it */ if ((shp-page)%8 == 4 && shp + 4 <= page + page_size && - (*(uint32_t *)shp == 0x00000000 || - *(uint32_t *)shp == 0x20202020 || - ctx->vendor != READSTAT_VENDOR_STAT_TRANSFER)) { + (*(uint32_t *)shp == 0x00000000 || *(uint32_t *)shp == 0x20202020) && + ctx->vendor != READSTAT_VENDOR_STAT_TRANSFER) { data = shp + 4; } else { data = shp;