subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From phi...@apache.org
Subject svn commit: r1467237 - in /subversion/trunk/subversion: libsvn_subr/subst.c tests/libsvn_subr/subst_translate-test.c
Date Fri, 12 Apr 2013 10:58:49 GMT
Author: philip
Date: Fri Apr 12 10:58:49 2013
New Revision: 1467237

URL: http://svn.apache.org/r1467237
Log:
Fix issue 4350, long keyword expansion.

* subversion/libsvn_subr/subst.c
  (translate_keyword_subst): Don't expand overlong keywords.

* subversion/tests/libsvn_subr/subst_translate-test.c
  (test_funcs): Mark test_svn_subst_long_keywords PASS.

Modified:
    subversion/trunk/subversion/libsvn_subr/subst.c
    subversion/trunk/subversion/tests/libsvn_subr/subst_translate-test.c

Modified: subversion/trunk/subversion/libsvn_subr/subst.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/subst.c?rev=1467237&r1=1467236&r2=1467237&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/subst.c (original)
+++ subversion/trunk/subversion/libsvn_subr/subst.c Fri Apr 12 10:58:49 2013
@@ -450,6 +450,11 @@ translate_keyword_subst(char *buf,
   if (*len < keyword_len + 2)
     return FALSE;
 
+  /* Need at least space for two $'s, two spaces and a colon, and that
+     leaves zero space for the value itself. */
+  if (keyword_len > SVN_KEYWORD_MAX_LEN - 5)
+    return FALSE;
+
   /* The keyword needs to match what we're looking for. */
   if (strncmp(buf + 1, keyword, keyword_len))
     return FALSE;

Modified: subversion/trunk/subversion/tests/libsvn_subr/subst_translate-test.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_subr/subst_translate-test.c?rev=1467237&r1=1467236&r2=1467237&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_subr/subst_translate-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_subr/subst_translate-test.c Fri Apr 12 10:58:49
2013
@@ -498,7 +498,7 @@ struct svn_test_descriptor_t test_funcs[
                    "test svn_subst_build_keywords3()"),
     SVN_TEST_PASS2(test_svn_subst_truncated_keywords,
                    "test truncated keywords (issue 4349)"),
-    SVN_TEST_XFAIL2(test_svn_subst_long_keywords,
+    SVN_TEST_PASS2(test_svn_subst_long_keywords,
                    "test long keywords (issue 4350)"),
     SVN_TEST_NULL
   };



Mime
View raw message