mirror of https://github.com/sipwise/kamailio.git
This patch check if the name passed to $avp was correctly initialized. If not initialized it will print an error message and return 0 (no match). Change-Id: Icc84f0ff1103eb759b2282bd76951a8410225910pull/12/head
parent
311b1de269
commit
2000c2e5b5
@ -0,0 +1,13 @@
|
||||
--- a/src/core/usr_avp.c
|
||||
+++ b/src/core/usr_avp.c
|
||||
@@ -391,6 +391,10 @@ static inline int match_by_id(avp_t *avp
|
||||
static inline int match_by_name(avp_t *avp, avp_id_t id, str *name)
|
||||
{
|
||||
str *avp_name;
|
||||
+ if (!name || !name->s || name->len <= 0) {
|
||||
+ LM_ERR("Invalid AVP name pointer\n");
|
||||
+ return 0;
|
||||
+ }
|
||||
if(id == avp->id && avp->flags & AVP_NAME_STR
|
||||
&& (avp_name = get_avp_name(avp)) != 0 && avp_name->len == name->len
|
||||
&& !strncasecmp(avp_name->s, name->s, name->len)) {
|
||||
Loading…
Reference in new issue