Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions src/sas/readstat_sas7bdat_read.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down