subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gst...@apache.org
Subject svn commit: r1337633 - /subversion/trunk/subversion/libsvn_ra_serf/xml.c
Date Sat, 12 May 2012 20:15:44 GMT
Author: gstein
Date: Sat May 12 20:15:44 2012
New Revision: 1337633

URL: http://svn.apache.org/viewvc?rev=1337633&view=rev
Log:
An element's cdata is not always collected. Conditionally convert the
cdata into an svn_string_t.

* subversion/libsvn_ra_serf/xml.c:
  (svn_ra_serf__xml_cb_end): cdata may be NULL.

Modified:
    subversion/trunk/subversion/libsvn_ra_serf/xml.c

Modified: subversion/trunk/subversion/libsvn_ra_serf/xml.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_serf/xml.c?rev=1337633&r1=1337632&r2=1337633&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_serf/xml.c (original)
+++ subversion/trunk/subversion/libsvn_ra_serf/xml.c Sat May 12 20:15:44 2012
@@ -660,13 +660,19 @@ svn_ra_serf__xml_cb_end(svn_ra_serf__xml
     {
       const svn_string_t *cdata;
 
-      cdata = svn_stringbuf__morph_into_string(xes->cdata);
+      if (xes->cdata)
+        {
+          cdata = svn_stringbuf__morph_into_string(xes->cdata);
 #ifdef SVN_DEBUG
-      /* We might toss the pool holding this structure, but it could also
-         be within a parent pool. In any case, for safety's sake, disable
-         the stringbuf against future Badness.  */
-      xes->cdata->pool = NULL;
+          /* We might toss the pool holding this structure, but it could also
+             be within a parent pool. In any case, for safety's sake, disable
+             the stringbuf against future Badness.  */
+          xes->cdata->pool = NULL;
 #endif
+        }
+      else
+        cdata = NULL;
+
       SVN_ERR(xmlctx->closed_cb(xes, xmlctx->baton, xes->state,
                                 cdata, xes->attrs,
                                 xmlctx->scratch_pool));



Mime
View raw message