[gnome-keyring] gcr: Fix invalid memory access in _gcr_record_set_base64



commit 0153e2bd9fb47ccb83bff6010713d14f8f75c349
Author: Stef Walter <stefw collabora co uk>
Date:   Tue Sep 27 16:47:37 2011 +0200

    gcr: Fix invalid memory access in _gcr_record_set_base64

 gcr/gcr-record.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/gcr/gcr-record.c b/gcr/gcr-record.c
index c543e97..7b065eb 100644
--- a/gcr/gcr-record.c
+++ b/gcr/gcr-record.c
@@ -668,10 +668,10 @@ _gcr_record_set_base64 (GcrRecord *record,
 	                               block->value, &state, &save);
 	length += g_base64_encode_close (TRUE, block->value + length,
 	                                 &state, &save);
-	g_strchomp (block->value);
-	g_assert (length < estimate);
 	block->value[length] = 0;
+	g_assert (length < estimate);
 
+	g_strchomp (block->value);
 	record_take_column (record, column, block);
 }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]