Module: sip-router
Branch: master
Commit: e633ca6b7e748a77825d3208e86bf9bce18944a5
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=e633ca6…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: Thu May 29 17:06:13 2014 +0200
pv: safety check for PAI header parsed structure
- reported by Igor Potjevlesch
---
modules/pv/pv_core.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/modules/pv/pv_core.c b/modules/pv/pv_core.c
index c472622..876a246 100644
--- a/modules/pv/pv_core.c
+++ b/modules/pv/pv_core.c
@@ -994,6 +994,11 @@ int pv_get_pai(struct sip_msg *msg, pv_param_t *param,
}
pai_body = get_pai(msg);
+ if(pai_body==NULL || pai_body->id==NULL)
+ {
+ LM_DBG("no P-Asserted-Identity header or empty body\n");
+ return pv_get_null(msg, param, res);
+ }
pai_uri = &pai_body->id[0];
cur_id = 0;
i = 0;