summaryrefslogtreecommitdiffstats
path: root/libglusterfs
diff options
context:
space:
mode:
authorVijaykumar Koppad <vkoppad@redhat.com>2013-03-27 14:14:41 +0530
committerAnand Avati <avati@redhat.com>2013-03-27 11:06:55 -0700
commit158e51c17c0f569a1c107fa8747cf8d3fdb76b6d (patch)
tree0b9c86c6f0b617d9b65abacf771eda9ef558059b /libglusterfs
parent20b1be77f6cd7ddebedb0cc64d419b5686e5d56e (diff)
libglusterfs/dict: fix infinite loop in dict_keys_join()
- missing "pairs = next" caused infinite loop Change-Id: I3edc4f50473f7498815c73e1066167392718fddf BUG: 905871 Signed-off-by: Vijaykumar Koppad <vkoppad@redhat.com> Reviewed-on: http://review.gluster.org/4728 Reviewed-by: Jeff Darcy <jdarcy@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
Diffstat (limited to 'libglusterfs')
-rw-r--r--libglusterfs/src/dict.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libglusterfs/src/dict.c b/libglusterfs/src/dict.c
index a8cdeaf28..72dd7e7aa 100644
--- a/libglusterfs/src/dict.c
+++ b/libglusterfs/src/dict.c
@@ -1180,8 +1180,10 @@ dict_keys_join (void *value, int size, dict_t *dict,
while (pairs) {
next = pairs->next;
- if (filter_fn && filter_fn (pairs->key))
- continue;
+ if (filter_fn && filter_fn (pairs->key)){
+ pairs = next;
+ continue;
+ }
if (value && (size > len))
strncpy (value + len, pairs->key, size - len);