[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

[PATCH] Stop "svn lock" crashing if editor exits without saving a lock message

From: Michael W Thelen <mike_at_pietdepsi.com>
Date: 2005-04-09 00:22:46 CEST

Peter N. Lundblad wrote:
> libsvn_ra_dav violates its API. The comment is optional and may be NULL.
> So, the bug is there. ra_local and ra_svn both accept a NULL pointer.

Ignoring the issue of user-friendliness of the editor for now, here's a
patch to simply avoid the crash.

[[[
* subversion/libsvn_ra_dav/session.c (shim_svn_ra_dav__lock): Fix a
   crash by not passing NULL to apr_xml_quote_string when the comment
   is NULL.
]]]

Index: subversion/libsvn_ra_dav/session.c
===================================================================
--- subversion/libsvn_ra_dav/session.c (revision 14052)
+++ subversion/libsvn_ra_dav/session.c (working copy)
@@ -1008,7 +1008,8 @@

    /* Make a neon lock structure. */
    nlock = ne_lock_create();
- nlock->owner = ne_strdup(apr_xml_quote_string(pool, comment, 1));
+ nlock->owner = comment ? ne_strdup(apr_xml_quote_string(pool,
comment, 1))
+ : NULL;

    if ((rv = ne_uri_parse(url, &(nlock->uri))))
      {

--
Michael W Thelen
It is a mistake to think you can solve any major problems just with
potatoes.       -- Douglas Adams

Received on Sat Apr 9 00:24:59 2005

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.