[sr-dev] git:master:ff2e0d96: core: dns cachec- safety check in log message before abort

Daniel-Constantin Mierla miconda at gmail.com
Sun Jul 2 12:28:57 CEST 2017


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

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2017-07-02T12:22:33+02:00

core: dns cachec- safety check in log message before abort

---

Modified: src/core/dns_cache.c

---

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

---

diff --git a/src/core/dns_cache.c b/src/core/dns_cache.c
index 3b0f5404c4..577eb48d1f 100644
--- a/src/core/dns_cache.c
+++ b/src/core/dns_cache.c
@@ -456,8 +456,10 @@ int init_dns_cache_stats(int iproc_num)
 		LM_CRIT("%s: crt(%p, %p, %p)," \
 					" prev(%p, %p, %p), next(%p, %p, %p)\n", txt, \
 					(l), (l)->next, (l)->prev, \
-					(l)->prev, (l)->prev->next, (l)->prev->prev, \
-					(l)->next, (l)->next->next, (l)->next->prev \
+					(l)->prev, ((l)->prev)?(l)->prev->next:NULL, \
+					((l)->prev)?(l)->prev->prev:NULL, \
+					(l)->next, ((l)->next)?(l)->next->next:NULL, \
+					((l)->next)?(l)->next->prev:NULL \
 				)
 
 #define debug_lu_lst( txt, l) \




More information about the sr-dev mailing list