You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2014/01/26 23:59:30 UTC

svn commit: r1561570 - /subversion/trunk/subversion/libsvn_ra_svn/marshal.c

Author: stefan2
Date: Sun Jan 26 22:59:29 2014
New Revision: 1561570

URL: http://svn.apache.org/r1561570
Log:
Remove false protocol limit checks from the ra_svn marshaller.

* subversion/libsvn_ra_svn/marshal.c
  (svn_ra_svn__read_data_log_changed_entry): Remove upper limit
   check for variable length elements as they may be extended by
   later releases.

Modified:
    subversion/trunk/subversion/libsvn_ra_svn/marshal.c

Modified: subversion/trunk/subversion/libsvn_ra_svn/marshal.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_svn/marshal.c?rev=1561570&r1=1561569&r2=1561570&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_svn/marshal.c (original)
+++ subversion/trunk/subversion/libsvn_ra_svn/marshal.c Sun Jan 26 22:59:29 2014
@@ -40,6 +40,7 @@
 #include "svn_pools.h"
 #include "svn_ra_svn.h"
 #include "svn_ctype.h"
+#include "svn_sorts.h"
 #include "svn_time.h"
 
 #include "ra_svn.h"
@@ -2607,7 +2608,7 @@ svn_ra_svn__read_data_log_changed_entry(
   *prop_mods = SVN_RA_SVN_UNSPECIFIED_NUMBER;
 
   /* top-level elements (mandatory) */
-  SVN_ERR(svn_ra_svn__read_check_array_size(items, 3, 4));
+  SVN_ERR(svn_ra_svn__read_check_array_size(items, 3, INT_MAX));
   SVN_ERR(svn_ra_svn__read_string(items, 0, cpath));
   SVN_ERR(svn_ra_svn__read_word(items, 1, action));
 
@@ -2621,12 +2622,10 @@ svn_ra_svn__read_data_log_changed_entry(
     }
 
   /* second sub-structure (optional) */
-  if (items->nelts == 4)
+  if (items->nelts >= 4)
     {
       SVN_ERR(svn_ra_svn__read_list(items, 3, &sub_items));
-      SVN_ERR(svn_ra_svn__read_check_array_size(sub_items, 0, 3));
-
-      switch (sub_items->nelts)
+      switch (MIN(3, sub_items->nelts))
         {
           case 3 : SVN_ERR(svn_ra_svn__read_boolean(sub_items, 2, prop_mods));
           case 2 : SVN_ERR(svn_ra_svn__read_boolean(sub_items, 1, text_mods));



Re: svn commit: r1561570 - /subversion/trunk/subversion/libsvn_ra_svn/marshal.c

Posted by Stefan Fuhrmann <st...@wandisco.com>.
On Mon, Jan 27, 2014 at 12:48 AM, Bert Huijben <be...@qqmail.nl> wrote:

>
>
> > -----Original Message-----
> > From: stefan2@apache.org [mailto:stefan2@apache.org]
> > Sent: maandag 27 januari 2014 00:00
> > To: commits@subversion.apache.org
> > Subject: svn commit: r1561570 -
> > /subversion/trunk/subversion/libsvn_ra_svn/marshal.c
> >
> > Author: stefan2
> > Date: Sun Jan 26 22:59:29 2014
> > New Revision: 1561570
> >
> > URL: http://svn.apache.org/r1561570
> > Log:
> > Remove false protocol limit checks from the ra_svn marshaller.
> >
> > * subversion/libsvn_ra_svn/marshal.c
> >   (svn_ra_svn__read_data_log_changed_entry): Remove upper limit
> >    check for variable length elements as they may be extended by
> >    later releases.
>
> I don't think we can change these entries without a time machine if these
> limits were coded in previously released versions?
>
> Were these checks added for 1.9?
>

Yes, they had and those checks were too strict. The protocol
allows for adding an unlimited number of optional elements.

-- Stefan^2.

RE: svn commit: r1561570 - /subversion/trunk/subversion/libsvn_ra_svn/marshal.c

Posted by Bert Huijben <be...@qqmail.nl>.

> -----Original Message-----
> From: stefan2@apache.org [mailto:stefan2@apache.org]
> Sent: maandag 27 januari 2014 00:00
> To: commits@subversion.apache.org
> Subject: svn commit: r1561570 -
> /subversion/trunk/subversion/libsvn_ra_svn/marshal.c
> 
> Author: stefan2
> Date: Sun Jan 26 22:59:29 2014
> New Revision: 1561570
> 
> URL: http://svn.apache.org/r1561570
> Log:
> Remove false protocol limit checks from the ra_svn marshaller.
> 
> * subversion/libsvn_ra_svn/marshal.c
>   (svn_ra_svn__read_data_log_changed_entry): Remove upper limit
>    check for variable length elements as they may be extended by
>    later releases.

I don't think we can change these entries without a time machine if these limits were coded in previously released versions?

Were these checks added for 1.9?

	Bert