[sr-dev] git:master:e8cd7643: siptrace: check auth_key_str.s before dereference

Daniel-Constantin Mierla miconda at gmail.com
Fri Jul 28 10:39:27 CEST 2017


Module: kamailio
Branch: master
Commit: e8cd7643bbdf4b8f187a35bb0e707f4d6eda09b7
URL: https://github.com/kamailio/kamailio/commit/e8cd7643bbdf4b8f187a35bb0e707f4d6eda09b7

Author: Mikko Lehto <mslehto at iki.fi>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2017-07-28T10:39:23+02:00

siptrace: check auth_key_str.s before dereference

---

Modified: src/modules/siptrace/siptrace.c

---

Diff:  https://github.com/kamailio/kamailio/commit/e8cd7643bbdf4b8f187a35bb0e707f4d6eda09b7.diff
Patch: https://github.com/kamailio/kamailio/commit/e8cd7643bbdf4b8f187a35bb0e707f4d6eda09b7.patch

---

diff --git a/src/modules/siptrace/siptrace.c b/src/modules/siptrace/siptrace.c
index 987a20aed7..1969384d41 100644
--- a/src/modules/siptrace/siptrace.c
+++ b/src/modules/siptrace/siptrace.c
@@ -1774,7 +1774,7 @@ static int trace_send_hep3_duplicate(str *body, str *from, str *to, struct dest_
 			HEP3_PACK_CHUNK_DATA (0, 0x0011, correlation_id_str->s, correlation_id_str->len);
 		}
 	}
-	if (auth_key_str.len) {
+	if (auth_key_str.s && auth_key_str.len > 0) {
 		HEP3_PACK_CHUNK_DATA(0, 0x000e, auth_key_str.s, auth_key_str.len);
 	}
 	HEP3_PACK_CHUNK_DATA (0, 0x000f, body->s, body->len);
@@ -2393,7 +2393,7 @@ static int hlog(struct sip_msg *msg, str *correlationid, str *message) {
 	HEP3_PACK_CHUNK_UINT8 (0, 0x000b, 0x64); /* protocol type: log */
 	HEP3_PACK_CHUNK_UINT32(0, 0x000c, hep_capture_id);
 	HEP3_PACK_CHUNK_DATA  (0, 0x0011, correlationid->s, correlationid->len);
-	if (auth_key_str.len) {
+	if (auth_key_str.s && auth_key_str.len > 0) {
 		HEP3_PACK_CHUNK_DATA(0, 0x000e, auth_key_str.s, auth_key_str.len);
 	}
 	HEP3_PACK_CHUNK_DATA  (0, 0x000f, message->s, message->len);




More information about the sr-dev mailing list