summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Toshok <toshok@ximian.com>2004-02-04 18:42:17 +0000
committerChris Toshok <toshok@src.gnome.org>2004-02-04 18:42:17 +0000
commitcc01b41660498968aaa2cb94376fdf0aa02623bd (patch)
treefb404a3cccd8fbc77a794e6946985cfed0339cd8
parent58106fe2153007aac091ac9b92c9c9da013c9fe0 (diff)
downloadevolution-data-server-cc01b41660498968aaa2cb94376fdf0aa02623bd.tar.gz
[ fixes bug #53130 ]
2004-02-04 Chris Toshok <toshok@ximian.com> [ fixes bug #53130 ] * libedata-book/e-data-book-view.c (MAKE_REALLOC): this might end up being a bad assumption, but since it's only used for string sequences, assume it always will be. We need to make a deep copy of the sequence. a memcpy isn't enough, as freeing the buffer causes the child strings to be freed.
-rw-r--r--addressbook/ChangeLog10
-rw-r--r--addressbook/libedata-book/e-data-book-view.c5
2 files changed, 13 insertions, 2 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog
index 06c1890f4..01c8fef3a 100644
--- a/addressbook/ChangeLog
+++ b/addressbook/ChangeLog
@@ -1,5 +1,15 @@
2004-02-04 Chris Toshok <toshok@ximian.com>
+ [ fixes bug #53130 ]
+
+ * libedata-book/e-data-book-view.c (MAKE_REALLOC): this might end
+ up being a bad assumption, but since it's only used for string
+ sequences, assume it always will be. We need to make a deep copy
+ of the sequence. a memcpy isn't enough, as freeing the buffer
+ causes the child strings to be freed.
+
+2004-02-04 Chris Toshok <toshok@ximian.com>
+
* libebook/e-book.c (e_book_op_free): remove the misleading "XXX
more here" comment from here - there's nothing else to free here.
diff --git a/addressbook/libedata-book/e-data-book-view.c b/addressbook/libedata-book/e-data-book-view.c
index 8db46ee72..8ff3c70a0 100644
--- a/addressbook/libedata-book/e-data-book-view.c
+++ b/addressbook/libedata-book/e-data-book-view.c
@@ -129,9 +129,10 @@ CORBA_sequence_ ## type ## _realloc (CORBA_sequence_ ## type *seq, \
CORBA_unsigned_long new_max) \
{ \
type *new_buf; \
- \
+ int i; \
new_buf = CORBA_sequence_ ## type ## _allocbuf (new_max); \
- memcpy (new_buf, seq->_buffer, seq->_maximum * sizeof (type)); \
+ for (i = 0; i < seq->_maximum; i ++) \
+ new_buf[i] = CORBA_string_dup (seq->_buffer[i]); \
CORBA_free (seq->_buffer); \
seq->_buffer = new_buf; \
seq->_maximum = new_max; \