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 2013/05/24 13:25:58 UTC
svn commit: r1486014 - /subversion/trunk/subversion/libsvn_ra_svn/marshal.c
Author: stefan2
Date: Fri May 24 11:25:57 2013
New Revision: 1486014
URL: http://svn.apache.org/r1486014
Log:
Correct an error message and use a #define instead of a magic number.
No functional change.
* subversion/libsvn_ra_svn/marshal.c
(ITEM_NESTING_LIMIT): define new constant
(read_item): the problem is recursion not data size; use new constant
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=1486014&r1=1486013&r2=1486014&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_svn/marshal.c (original)
+++ subversion/trunk/subversion/libsvn_ra_svn/marshal.c Fri May 24 11:25:57 2013
@@ -62,6 +62,13 @@
*/
#define MAX_WORD_LENGTH 31
+/* The generic parsers will use the following value to limit the recursion
+ * depth to some reasonable value. The current protocol implementation
+ * actually uses only maximum item nesting level of around 5. So, there is
+ * plenty of headroom here.
+ */
+#define ITEM_NESTING_LIMIT 64
+
/* Return the APR socket timeout to be used for the connection depending
* on whether there is a blockage handler or zero copy has been activated. */
static apr_interval_time_t
@@ -1020,9 +1027,9 @@ static svn_error_t *read_item(svn_ra_svn
svn_stringbuf_t *str;
svn_ra_svn_item_t *listitem;
- if (++level >= 64)
+ if (++level >= ITEM_NESTING_LIMIT)
return svn_error_create(SVN_ERR_RA_SVN_MALFORMED_DATA, NULL,
- _("Too many nested items"));
+ _("Items are nested too deeply"));
/* Determine the item type and read it in. Make sure that c is the