Skip to content

Validate SAV missing-value count before abs() - #395

Merged
evanmiller merged 1 commit into
devfrom
fix-sav-missing-values-overflow
Sep 13, 2026
Merged

evanmiller merged 1 commit into
devfrom
fix-sav-missing-values-overflow

Conversation

@evanmiller

Copy link
Copy Markdown
Contributor

OSS-Fuzz 471515730 (fuzz_format_sav): readstat_parse_sav reported a signed integer overflow in sav_skip_variable_record. The variable record's n_missing_values field is attacker-controlled, and

abs(n_missing_values) * sizeof(double)

is undefined when n_missing_values is INT_MIN (negating -2147483648 overflows int). Apply the same -3..3 bound that
sav_read_variable_missing_values already enforces before taking the absolute value, rejecting the record as a parse error otherwise.

Claude-Session: https://claude.ai/code/session_01VbdjJ6i4dby3R6KM6m4Rpi

OSS-Fuzz 471515730 (fuzz_format_sav): readstat_parse_sav reported a
signed integer overflow in sav_skip_variable_record. The variable
record's n_missing_values field is attacker-controlled, and

    abs(n_missing_values) * sizeof(double)

is undefined when n_missing_values is INT_MIN (negating -2147483648
overflows int). Apply the same -3..3 bound that
sav_read_variable_missing_values already enforces before taking the
absolute value, rejecting the record as a parse error otherwise.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VbdjJ6i4dby3R6KM6m4Rpi
@evanmiller
evanmiller force-pushed the fix-sav-missing-values-overflow branch from 2a6fec4 to 1346997 Compare September 13, 2026 18:58
@evanmiller
evanmiller merged commit 84c2d6b into dev Sep 13, 2026
23 checks passed
@evanmiller
evanmiller deleted the fix-sav-missing-values-overflow branch September 14, 2026 02:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant