bneradt commented on code in PR #12614:
URL: https://github.com/apache/trafficserver/pull/12614#discussion_r2467185526
##########
plugins/experimental/uri_signing/unit_tests/uri_signing_test.cc:
##########
@@ -225,9 +225,17 @@ jws_parsing_helper(const char *uri, const char *paramName,
const char *expected_
cjose_jws_t *jws = get_jws_from_uri(uri, uri_ct, paramName, uri_strip,
uri_ct, &strip_ct);
if (jws) {
resp = true;
- if (strcmp(uri_strip, expected_strip) != 0) {
- cjose_jws_release(jws);
- resp = false;
+ if (expected_strip != nullptr) {
+ if (strcmp(uri_strip, expected_strip) != 0) {
+ cjose_jws_release(jws);
+ resp = false;
+ }
+ } else {
+ // expected_strip == nullptr means we expect uri_strip to be empty
+ if (uri_strip[0] != '\0') {
+ cjose_jws_release(jws);
+ resp = false;
+ }
Review Comment:
I requested it here:
https://github.com/apache/trafficserver/pull/12614#discussion_r2461797249
The callers used nullptr, but we didn't verify anything with it. Bryan is
now adding verification when nullptr is passed in.
--
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]