Daniel Rall <dlr@finemaltcoding.com> wrote on 10/18/2005 01:10:26 PM:
> Peter and I also tracked this to the same spot. I wrote a simple patch
a
> while ago, and am trying to get my httpd WC into a testable state.
>
> To fix this problem, checking for a NULL value for "svn:author" is
really
> all that's needed, but perhaps the following patch would be better
(given
> that it's more defensive against other unexpected NULL values)?
>
> [[[
> * subversion/libsvn_wc/status.c
> (change_dir_prop): Assure that we actually have a value for
> properties sent from the repository before trying to use them.
> ]]]
>
>
> --- subversion/libsvn_wc/status.c (revision 16782)
> +++ subversion/libsvn_wc/status.c (working copy)
> @@ -1504,15 +1504,18 @@
> db->prop_changed = TRUE;
>
> /* Note any changes to the repository. */
> - if (strcmp (name, SVN_PROP_ENTRY_COMMITTED_REV) == 0)
> - db->ood_last_cmt_rev = SVN_STR_TO_REV (value->data);
> - else if (strcmp (name, SVN_PROP_ENTRY_LAST_AUTHOR) == 0)
> - db->ood_last_cmt_author = apr_pstrdup (db->pool, value->data);
> - else if (strcmp (name, SVN_PROP_ENTRY_COMMITTED_DATE) == 0)
> + if (value != NULL)
> {
> - apr_time_t tm;
> - SVN_ERR (svn_time_from_cstring (&tm, value->data, db->pool));
> - db->ood_last_cmt_date = tm;
> + if (strcmp (name, SVN_PROP_ENTRY_COMMITTED_REV) == 0)
> + db->ood_last_cmt_rev = SVN_STR_TO_REV (value->data);
> + else if (strcmp (name, SVN_PROP_ENTRY_LAST_AUTHOR) == 0)
> + db->ood_last_cmt_author = apr_pstrdup (db->pool, value->data);
> + else if (strcmp (name, SVN_PROP_ENTRY_COMMITTED_DATE) == 0)
> + {
> + apr_time_t tm;
> + SVN_ERR (svn_time_from_cstring (&tm, value->data, db->pool));
> + db->ood_last_cmt_date = tm;
> + }
> }
>
> return SVN_NO_ERROR;
Daniel,
I just confirmed that this problem can also occur in change_file_prop.
This variation of your previous patch fixes that as well.
Paul B.
[[[
* subversion/libsvn_wc/status.c
(change_file_prop): Assure that we actually have a value for
properties sent from the repository before trying to use them.
]]]
Index: subversion/libsvn_wc/status.c
===================================================================
--- subversion/libsvn_wc/status.c (revision 16791)
+++ subversion/libsvn_wc/status.c (working copy)
@@ -1697,16 +1697,19 @@
fb->prop_changed = TRUE;
/* Note any changes to the repository. */
- if (strcmp (name, SVN_PROP_ENTRY_COMMITTED_REV) == 0)
- fb->ood_last_cmt_rev = SVN_STR_TO_REV (value->data);
- else if (strcmp (name, SVN_PROP_ENTRY_LAST_AUTHOR) == 0)
- fb->ood_last_cmt_author = apr_pstrdup (fb->dir_baton->pool,
- value->data);
- else if (strcmp (name, SVN_PROP_ENTRY_COMMITTED_DATE) == 0)
+ if (value != NULL)
{
- apr_time_t tm;
- SVN_ERR (svn_time_from_cstring (&tm, value->data,
fb->dir_baton->pool));
- fb->ood_last_cmt_date = tm;
+ if (strcmp (name, SVN_PROP_ENTRY_COMMITTED_REV) == 0)
+ fb->ood_last_cmt_rev = SVN_STR_TO_REV (value->data);
+ else if (strcmp (name, SVN_PROP_ENTRY_LAST_AUTHOR) == 0)
+ fb->ood_last_cmt_author = apr_pstrdup (fb->dir_baton->pool,
+ value->data);
+ else if (strcmp (name, SVN_PROP_ENTRY_COMMITTED_DATE) == 0)
+ {
+ apr_time_t tm;
+ SVN_ERR (svn_time_from_cstring (&tm, value->data,
fb->dir_baton->pool));
+ fb->ood_last_cmt_date = tm;
+ }
}
return SVN_NO_ERROR;
_____________________________________________________________________________
Scanned for SoftLanding Systems, Inc. and SoftLanding Europe Plc by IBM Email Security Management Services powered by MessageLabs.
_____________________________________________________________________________
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Oct 18 21:20:37 2005