[sr-dev] git:master:56340d42: modules/ims_auth: buffer protection

jaybeepee jason.penton at gmail.com
Tue Sep 13 11:08:18 CEST 2016


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

Author: jaybeepee <jason.penton at gmail.com>
Committer: jaybeepee <jason.penton at gmail.com>
Date: 2016-09-13T11:07:50+02:00

modules/ims_auth: buffer protection

---

Modified: modules/ims_auth/authorize.c

---

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

---

diff --git a/modules/ims_auth/authorize.c b/modules/ims_auth/authorize.c
index 8343de4..a89b15e 100644
--- a/modules/ims_auth/authorize.c
+++ b/modules/ims_auth/authorize.c
@@ -1307,9 +1307,11 @@ auth_vector * new_auth_vector(int item_number, str auth_scheme, str authenticate
     x->status = AUTH_VECTOR_UNUSED;
     x->expires = 0;
 
-	base16_ck_len = bin_to_base16(x->ck.s, 16, base16_ck);
-	if (base16_ck_len)
-		LM_DBG("new auth-vector with ck [%s] with status %d\n", base16_ck, x->status);
+	if (x->ck.len > 0 && x->ck.s) {
+		base16_ck_len = bin_to_base16(x->ck.s, 16, base16_ck);
+		if (base16_ck_len)
+			LM_DBG("new auth-vector with ck [%s] with status %d\n", base16_ck, x->status);
+	}
 
 done:
     return x;




More information about the sr-dev mailing list