sjawhar opened a new pull request, #3674: URL: https://github.com/apache/brpc/pull/3674
### What problem does this PR solve? Issue Number: none Problem Summary: AMF0 defines the markers 0x00 to 0x11. A larger marker falls out of the value switches in both `ReadAMFObjectField` functions and in `ReadAMFArrayItem`. The functions then return true without reading a value, and the next bytes are read as the next field or item. #3597 fixed this for a stray object-end marker. Two more cases leave bytes unread: an unreadable typed-object class name, and an object value for a protobuf field that is not a message. ### What is changed and the side effects? Changed: - The three switches reject an undefined marker, an unreadable class name is an error, and an object value for a non-message field is skipped. - #3597's test becomes `RtmpTest.amf_rejects_invalid_value`, and `RtmpTest.amf_skips_object_value_of_non_message_field` is new. Both fail on master. Side effects: - Performance effects: none. - Breaking backward compatibility: an undefined marker or an unreadable class name is now rejected. Tested: `brpc_rtmp_unittest` passes (33 tests), clang 20. --- ### Check List: - Please make sure your changes are compilable. - When providing us with a new feature, it is best to add related tests. - Please follow [Contributor Covenant Code of Conduct](https://github.com/apache/brpc/blob/master/CODE_OF_CONDUCT.md). -- 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]
