You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by pb...@apache.org on 2011/01/13 20:58:13 UTC

svn commit: r1058722 - /subversion/trunk/subversion/libsvn_ra_serf/update.c

Author: pburba
Date: Thu Jan 13 19:58:13 2011
New Revision: 1058722

URL: http://svn.apache.org/viewvc?rev=1058722&view=rev
Log:
Fix a devious ra_serf bug that has been thwarting my issue #3657 efforts.

* subversion/libsvn_ra_serf/update.c

  (start_report): Initialize report_info_t's prop_encoding member if STATE
   is IGNORE_PROP_NAME or NEED_PROP_NAME.  Why?  Because we advance the
   parser to the PROP state in these cases and when close_report() handles
   this state it will attempt to use the same prop_encoding member to
   determine if the property value it passes to svn_ra_serf__set_ver_prop()
   needs decoding or not, but *since* we weren't initializing this value,
   the value is coming from whatever was previously in the
   svn_ra_serf__xml_parser_t's FREE_STATE member (which is reused by new
   states, see svn_ra_serf__xml_push_state() and struct
   svn_ra_serf__xml_parser_t.  The potential problem here is that
   we might try to decode a property value from base64 that isn't actually
   encoded or might not decode a property value this is encoded.

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

Modified: subversion/trunk/subversion/libsvn_ra_serf/update.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_serf/update.c?rev=1058722&r1=1058721&r2=1058722&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_serf/update.c (original)
+++ subversion/trunk/subversion/libsvn_ra_serf/update.c Thu Jan 13 19:58:13 2011
@@ -1676,7 +1676,8 @@ start_report(svn_ra_serf__xml_parser_t *
     }
   else if (state == IGNORE_PROP_NAME)
     {
-      push_state(parser, ctx, PROP);
+      report_info_t *info = push_state(parser, ctx, PROP);
+      info->prop_encoding = svn_xml_get_attr_value("encoding", attrs);
     }
   else if (state == NEED_PROP_NAME)
     {
@@ -1686,6 +1687,7 @@ start_report(svn_ra_serf__xml_parser_t *
 
       info->prop_ns = name.namespace;
       info->prop_name = apr_pstrdup(parser->state->pool, name.name);
+      info->prop_encoding = svn_xml_get_attr_value("encoding", attrs);
       info->prop_val = NULL;
       info->prop_val_len = 0;
     }