Skip to content

Commit

Permalink
[SAV reader] force parse error if attempting to decrement zero
Browse files Browse the repository at this point in the history
  • Loading branch information
evanmiller committed Feb 18, 2024
1 parent c7baae7 commit 887d3a1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/spss/readstat_sav_read.c
Original file line number Diff line number Diff line change
Expand Up @@ -717,7 +717,11 @@ static readstat_error_t sav_process_row(unsigned char *buffer, size_t buffer_len
}
if (++offset == col_info->width) {
if (++segment_offset < var_info->n_segments) {
if (raw_str_used > 0) raw_str_used--;
if (raw_str_used == 0) {
retval = READSTAT_ERROR_PARSE;
goto done;
}
raw_str_used--;
}
offset = 0;
col++;
Expand Down

0 comments on commit 887d3a1

Please sign in to comment.