Copilot commented on code in PR #3344:
URL: https://github.com/apache/brpc/pull/3344#discussion_r3409220570


##########
test/brpc_rtmp_unittest.cpp:
##########
@@ -523,6 +550,32 @@ TEST(RtmpTest, amf) {
     ASSERT_EQ("heheda", info3.description());
 }
 
+TEST(RtmpTest, amf_rejects_deep_nested_arrays) {
+    ScopedAMFMaxDepth scoped_depth(4);
+
+    std::string req_buf;
+    for (int i = 0; i <= brpc::FLAGS_amf_max_depth + 1; ++i) {

Review Comment:
   `amf_max_depth` is now enforced for both object bodies and strict arrays in 
`src/brpc/amf.cpp`, but this test only exercises the strict-array path. 
Consider adding a regression case for deeply-nested AMF objects (and/or ECMA 
arrays) to ensure the depth guard remains effective across all container types.



-- 
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]

Reply via email to