Fix potential crash with malformed reports

If reports contain an opening <object> tag, but omit the closing tag,
the html string is freed and still used some time later.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@22544 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Geert Janssens 2012-11-13 12:32:09 +00:00
parent 255d36f9e3
commit 89b65622e1

View File

@ -383,7 +383,7 @@ handle_embedded_object( GncHtmlWebkit* self, gchar* html_str )
Return the original html string because we can't properly parse it */ Return the original html string because we can't properly parse it */
g_free (classid_str); g_free (classid_str);
g_free (html_str_result); g_free (html_str_result);
return html_str; return g_strdup (html_str);
} }
end_object_tag += strlen( "</object>" ); end_object_tag += strlen( "</object>" );
object_contents = g_strndup( object_tag, (end_object_tag - object_tag) ); object_contents = g_strndup( object_tag, (end_object_tag - object_tag) );