Skip to content

Fix panic on empty integrity string from live platform API#455

Merged
Larusso merged 1 commit intomasterfrom
fix/modules_checksum_deserialization
Mar 7, 2026
Merged

Fix panic on empty integrity string from live platform API#455
Larusso merged 1 commit intomasterfrom
fix/modules_checksum_deserialization

Conversation

@Larusso
Copy link
Owner

@Larusso Larusso commented Mar 6, 2026

Description

Newer Unity versions return an empty string for the integrity field instead of null. ssri::Integrity::from_str("") silently produces an Integrity with zero hashes, causing i.check() to panic with an index-out-of-bounds error during checksum verification.

Changes

  • ![FIX] Treat empty integrity string as None in deserialize_sri via Some(s) if s.is_empty() guard
  • ![ADD] Unit tests for deserialize_sri covering empty string, null, missing field, and valid SRI

## Description

Newer Unity versions return an empty string for the `integrity` field
instead of `null`. `ssri::Integrity::from_str("")` silently produces an
`Integrity` with zero hashes, causing `i.check()` to panic with an
index-out-of-bounds error during checksum verification.

## Changes

* ![FIX] Treat empty `integrity` string as `None` in `deserialize_sri` via `Some(s) if s.is_empty()` guard
* ![ADD] Unit tests for `deserialize_sri` covering empty string, null, missing field, and valid SRI
@Larusso Larusso merged commit 2225f20 into master Mar 7, 2026
8 checks passed
@Larusso Larusso deleted the fix/modules_checksum_deserialization branch March 7, 2026 07:31
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