From 7e0eae49857e462e48fceda6e186a1a60624f43d Mon Sep 17 00:00:00 2001 From: Martin Willi Date: Thu, 3 Feb 2011 16:58:12 +0100 Subject: [PATCH] Replace hashtable key if a put operation replaces value Fixes a crash if lifetime of key is bound to value (i.e. key == value) --- src/libstrongswan/utils/hashtable.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libstrongswan/utils/hashtable.c b/src/libstrongswan/utils/hashtable.c index 3b7148e0be..49b0bb68c8 100644 --- a/src/libstrongswan/utils/hashtable.c +++ b/src/libstrongswan/utils/hashtable.c @@ -249,6 +249,7 @@ METHOD(hashtable_t, put, void*, { old_value = pair->value; pair->value = value; + pair->key = key; break; } } -- 2.47.2