Module: sip-router
Branch: 4.1
Commit: 7bdaca008e1bddbe9ab4db9d70e835ba45f6a5ff
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=7bdaca0…
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
(cherry picked from commit e633ca6b7e748a77825d3208e86bf9bce18944a5)
---
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 3f48830..59a3539 100644
--- a/modules/pv/pv_core.c
+++ b/modules/pv/pv_core.c
@@ -991,6 +991,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;