soup-cache: fix a use after free
authorSergio Villar Senin <svillar@igalia.com>
Mon, 13 Jun 2011 16:52:35 +0000 (18:52 +0200)
committerSergio Villar Senin <svillar@igalia.com>
Wed, 29 Jun 2011 15:02:12 +0000 (17:02 +0200)
commitfdab6aa450d59fdea765c50e8d176f9b963518c9
tree84250e330d9554b7a0c0411ad7830995eb473686
parent26c53ff8015368e2eb29316bd5736c1423171544
soup-cache: fix a use after free

Store a list of SoupBuffers to write data to cache instead of using
a GString. The reason is that g_string_append might reallocate the str
pointer, which is not guaranteed to keep pointing to the same area, and
which would cause the original area that was pointed to to be freed, leading
to the buffer passed to write() to be invalid.

https://bugzilla.gnome.org/show_bug.cgi?id=650620
libsoup/soup-cache.c