utafrali opened a new pull request, #3481: URL: https://github.com/apache/fory/pull/3481
Closes #3480 Cargo-fuzz was hitting several panics in the serialization code. Switched from unwrap/unreachable to proper error handling: - field_id calculation now uses checked_add to catch overflows instead of panicking - field name decoding switched from unwrap() to Result propagation - byte_to_encoding now returns Result for unknown encoding bytes instead of using unreachable!() - MetaStringBytes::new() updated to return Result so callers can handle invalid inputs All of these return the same error type so the call sites already handle it correctly. ## Why? Fuzzing found inputs that triggered panics. Better to return an error than crash. ## What does this PR do? Replaces panics with proper error returns in the metadata serialization paths. ## Related issues #3480 ## AI Contribution Checklist N/A ## Does this PR introduce any user-facing change? No. Valid inputs behave identically. Invalid/malformed data now returns an error instead of panicking. ## Benchmark N/A -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
