Repository navigation
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 31 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
What this change does: Replaces an abort and adds an offset check using setjmp/longjmp. Returning an error for malformed cabinets is valuable. Must fix: The new check adds two 32-bit offsets before comparing against the header size, so that addition can wrap. It also allows an offset exactly at the end of the buffer and does not check the number of bytes each caller will read. I ran a standalone probe with a 16-byte header and descriptor offset 8: offset 8 was accepted as the one-past-end pointer; offset Use widened arithmetic and validate the entire requested range at each parser boundary. Prefer ordinary error returns for these targeted failures rather than adding nonlocal exception handling. The new shell fixtures are also not registered with CTest, so the passing existing suite (24/24) does not exercise them. Verdict: Do not merge this old implementation. Keep the malformed-input error-handling goal, but replace it with focused validated fixes and integrated regression tests. #234 is a better example of a focused range check, though it covers a different parser boundary. Branch update correction: The initial update used a force-pushed rebase. The original PR commits have now been restored as first-parent history with a merge commit, pushed normally without force. Both the original and previously rebased commits remain reachable. The reviewed file contents are unchanged. Review basis: main |
Restore the original contribution commits as the first-parent history. Keep the reviewed conflict resolutions and current main without rewriting published history again.
|
Try to fix #44 in a better way. |
Is longjmp() better than abort()?
See #85 and #86