diff --git a/src/spss/readstat_sav_read.c b/src/spss/readstat_sav_read.c index 731f653..c219d12 100644 --- a/src/spss/readstat_sav_read.c +++ b/src/spss/readstat_sav_read.c @@ -926,6 +926,10 @@ 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) { + retval = READSTAT_ERROR_PARSE; + goto done; + } raw_str_used--; } offset = 0;