[sr-dev] git:4.1: modules/sca: fix hash entry deletion

Andrew Mortensen admorten at isc.upenn.edu
Fri Nov 15 22:33:40 CET 2013


Module: sip-router
Branch: 4.1
Commit: 7e74944eb6a55a5e9a817a894af1ebbbc8ce9733
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=7e74944eb6a55a5e9a817a894af1ebbbc8ce9733

Author: Timo Teräs <timo.teras at iki.fi>
Committer: Andrew Mortensen <admorten at isc.upenn.edu>
Date:   Fri Nov 15 16:06:25 2013 +0200

modules/sca: fix hash entry deletion

sca_hash_table_slot_kv_delete_unsafe() uses internally sca_hash_entry
but incorrectly called sca_hash_table_slot_kv_find_unsafe() to
initialize the entry. That function returns the node value, not the
node itself. Use instead sca_hash_table_slot_kv_find_entry_unsafe().

Should fix the crash in FS#366.

(cherry picked from commit 56e4f4518028e73f9ebd053242a100a5c3b7eb53)

---

 modules/sca/sca_hash.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/modules/sca/sca_hash.c b/modules/sca/sca_hash.c
index 996acd9..a92b6c4 100644
--- a/modules/sca/sca_hash.c
+++ b/modules/sca/sca_hash.c
@@ -264,7 +264,7 @@ sca_hash_table_slot_kv_delete_unsafe( sca_hash_slot *slot, str *key )
 {
     sca_hash_entry	*e;
 
-    e = sca_hash_table_slot_kv_find_unsafe( slot, key );
+    e = sca_hash_table_slot_kv_find_entry_unsafe( slot, key );
     if ( e == NULL ) {
 	return( -1 );
     }




More information about the sr-dev mailing list