Skip to content

Commit a85cff7

Browse files
authored
Fix nonnull warning in uri_signing unit tests (#12614)
1 parent 6195c2b commit a85cff7

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

plugins/experimental/uri_signing/unit_tests/uri_signing_test.cc

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -225,9 +225,15 @@ jws_parsing_helper(const char *uri, const char *paramName, const char *expected_
225225
cjose_jws_t *jws = get_jws_from_uri(uri, uri_ct, paramName, uri_strip, uri_ct, &strip_ct);
226226
if (jws) {
227227
resp = true;
228-
if (strcmp(uri_strip, expected_strip) != 0) {
229-
cjose_jws_release(jws);
230-
resp = false;
228+
if (expected_strip != nullptr) {
229+
if (strcmp(uri_strip, expected_strip) != 0) {
230+
resp = false;
231+
}
232+
} else {
233+
// expected_strip == nullptr means we expect uri_strip to be empty
234+
if (uri_strip[0] != '\0') {
235+
resp = false;
236+
}
231237
}
232238
} else {
233239
resp = false;

0 commit comments

Comments
 (0)