You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by iv...@apache.org on 2015/09/08 18:36:48 UTC
svn commit: r1701838 - /subversion/trunk/subversion/libsvn_wc/update_editor.c
Author: ivan
Date: Tue Sep 8 16:36:48 2015
New Revision: 1701838
URL: http://svn.apache.org/r1701838
Log:
Fix attempt to use uninitialized svn_wc__db_install_data_t pointer on error
in working copy update editor. I don't know exact reproduction script, but
this problem reported more than 400 times using TortoiseSVN crash reporter
tool.
* subversion/libsvn_wc/update_editor.c
(lazy_open_target): Do not rely that output parameter INSTALL_DATA will be
unchanged when svn_wc__db_pristine_prepare_install() returns error.
Modified:
subversion/trunk/subversion/libsvn_wc/update_editor.c
Modified: subversion/trunk/subversion/libsvn_wc/update_editor.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/update_editor.c?rev=1701838&r1=1701837&r2=1701838&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/update_editor.c (original)
+++ subversion/trunk/subversion/libsvn_wc/update_editor.c Tue Sep 8 16:36:48 2015
@@ -3551,15 +3551,23 @@ lazy_open_target(svn_stream_t **stream,
apr_pool_t *scratch_pool)
{
struct handler_baton *hb = baton;
+ svn_wc__db_install_data_t *install_data;
+ /* By convention return value is undefined on error, but we rely
+ on HB->INSTALL_DATA value in window_handler() and abort
+ INSTALL_STREAM if is not NULL on error.
+ So we store INSTALL_DATA to local variable first, to leave
+ HB->INSTALL_DATA unchanged on error. */
SVN_ERR(svn_wc__db_pristine_prepare_install(stream,
- &hb->install_data,
+ &install_data,
&hb->new_text_base_sha1_checksum,
NULL,
hb->fb->edit_baton->db,
hb->fb->dir_baton->local_abspath,
result_pool, scratch_pool));
+ hb->install_data = install_data;
+
return SVN_NO_ERROR;
}