[sr-dev] git:master: dialog(k): if h_id overflows unsigned int, start from 1 again

Daniel-Constantin Mierla miconda at gmail.com
Wed Apr 11 13:27:31 CEST 2012


Module: sip-router
Branch: master
Commit: 6b296c86e0eed99ef62b94e2ce076558d5c77df5
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=6b296c86e0eed99ef62b94e2ce076558d5c77df5

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date:   Wed Apr 11 12:11:13 2012 +0200

dialog(k): if h_id overflows unsigned int, start from 1 again

---

 modules_k/dialog/dlg_hash.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/modules_k/dialog/dlg_hash.c b/modules_k/dialog/dlg_hash.c
index 23930e7..06bf8d8 100644
--- a/modules_k/dialog/dlg_hash.c
+++ b/modules_k/dialog/dlg_hash.c
@@ -572,6 +572,7 @@ void link_dlg(struct dlg_cell *dlg, int n)
 
 	/* keep id 0 for special cases */
 	dlg->h_id = 1 + d_entry->next_id++;
+	if(dlg->h_id == 0) dlg->h_id = 1;
 	LM_DBG("linking dialog [%u:%u]\n", dlg->h_entry, dlg->h_id);
 	if (d_entry->first==0) {
 		d_entry->first = d_entry->last = dlg;




More information about the sr-dev mailing list