[sr-dev] git:master:47a776ef: http_client: check first if pointer is not exceeding limit

Daniel-Constantin Mierla miconda at gmail.com
Sat Mar 26 22:43:58 CET 2016


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

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2016-03-26T22:29:27+01:00

http_client: check first if pointer is not exceeding limit

- then test its value not to be null char

---

Modified: modules/http_client/curlcon.c

---

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

---

diff --git a/modules/http_client/curlcon.c b/modules/http_client/curlcon.c
index aa61860..b38a352 100644
--- a/modules/http_client/curlcon.c
+++ b/modules/http_client/curlcon.c
@@ -575,7 +575,7 @@ int fixup_raw_http_client_conn_list(void)
 		schema.s = raw_cc->url.s;
 		pos = schema.s;
 		end = raw_cc->url.s + raw_cc->url.len;
-		while (pos != '\0' && (pos < end))
+		while ((pos < end) && (*pos != '\0'))
 		{
 			if (*pos == ':') break;
 			pos++;




More information about the sr-dev mailing list