Skip to content

Commit

Permalink
Expect that protos[proto].name can be NULL.
Browse files Browse the repository at this point in the history
  • Loading branch information
sobomax committed Mar 23, 2023
1 parent c69513f commit 042ca31
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pvar.c
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@ static int pv_get_xuri_attr(struct sip_msg *msg, struct sip_uri *parsed_uri,
if(parsed_uri->transport_val.s==NULL) {
get_uri_port(parsed_uri, &proto);
proto_s.s = protos[proto].name;
proto_s.len = strlen(proto_s.s);
proto_s.len = proto_s.s ? strlen(proto_s.s) : 0;
return pv_get_strintval(msg, param, res, &proto_s, (int)proto);
}
return pv_get_strintval(msg, param, res, &parsed_uri->transport_val,
Expand Down Expand Up @@ -1415,7 +1415,7 @@ static int pv_get_dsturi_attr(struct sip_msg *msg, pv_param_t *param,
if(uri.transport_val.s==NULL) {
get_uri_port(&uri, &proto);
proto_s.s = protos[proto].name;
proto_s.len = strlen(proto_s.s);
proto_s.len = proto_s.s ? strlen(proto_s.s) : 0;
return pv_get_strintval(msg, param, res, &proto_s, (int)proto);
}
return pv_get_strintval(msg, param, res, &uri.transport_val,
Expand Down

0 comments on commit 042ca31

Please sign in to comment.