Skip to content

Commit

Permalink
Correct HACK logic for Stat/Transfer
Browse files Browse the repository at this point in the history
  • Loading branch information
mdb_services2 committed Oct 20, 2024
1 parent 104ba03 commit f783b3b
Showing 1 changed file with 3 additions and 4 deletions.
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) {

Check warning on line 986 in src/sas/readstat_sas7bdat_read.c

View check run for this annotation

Codecov / codecov/patch

src/sas/readstat_sas7bdat_read.c#L985-L986

Added lines #L985 - L986 were not covered by tests
data = shp + 4;
} else {
data = shp;
Expand Down

0 comments on commit f783b3b

Please sign in to comment.