Author: cmpilato Date: Wed May 16 13:47:45 2012 New Revision: 1339164 URL: http://svn.apache.org/viewvc?rev=1339164&view=rev Log: * subversion/libsvn_repos/replay.c (path_driver_cb_func): Avoid querying possibly uninitialized copyfrom-info- carrying variables.
Reported by: danielsh Modified: subversion/trunk/subversion/libsvn_repos/replay.c Modified: subversion/trunk/subversion/libsvn_repos/replay.c URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_repos/replay.c?rev=1339164&r1=1339163&r2=1339164&view=diff ============================================================================== --- subversion/trunk/subversion/libsvn_repos/replay.c (original) +++ subversion/trunk/subversion/libsvn_repos/replay.c Wed May 16 13:47:45 2012 @@ -705,13 +705,16 @@ path_driver_cb_func(void **dir_baton, if (! do_delete || do_add) { - /* Handle property modifications. + /* Is this a copy that was downgraded to a raw add? (If so, + we'll need to transmit properties and file contents and such + for it regardless of what the CHANGE structure's text_mod + and prop_mod flags say.) */ + svn_boolean_t downgraded_copy = (change->copyfrom_known + && change->copyfrom_path + && (! copyfrom_path)); - Note that this needs to happen in the "copy from a file or - directory we aren't allowed to see" case since otherwise the - caller will have no way to actually get those properties - which they are apparently allowed to see. */ - if (change->prop_mod || (change->copyfrom_path && ! copyfrom_path)) + /* Handle property modifications. */ + if (change->prop_mod || downgraded_copy) { apr_array_header_t *prop_diffs; apr_hash_t *old_props; @@ -741,14 +744,9 @@ path_driver_cb_func(void **dir_baton, } } - /* Handle textual modifications. - - Note that this needs to happen in the "copy from a file we - aren't allowed to see" case since otherwise the caller will - have no way to actually get the new file's contents, which - they are apparently allowed to see. */ + /* Handle textual modifications. */ if (change->node_kind == svn_node_file - && (change->text_mod || (change->copyfrom_path && ! copyfrom_path))) + && (change->text_mod || downgraded_copy)) { svn_txdelta_window_handler_t delta_handler; void *delta_handler_baton;