subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stef...@apache.org
Subject svn commit: r1228604 - /subversion/trunk/subversion/libsvn_subr/svn_string.c
Date Sat, 07 Jan 2012 12:30:19 GMT
Author: stefan2
Date: Sat Jan  7 12:30:18 2012
New Revision: 1228604

URL: http://svn.apache.org/viewvc?rev=1228604&view=rev
Log:
Harden the svn_cstring_tokenize implementation against NULL parameters.
Return NULL (i.e. "no more tokens") in that case.

* subversion/libsvn_subr/svn_string.c
  (svn_cstring_tokenize): check parameters

Modified:
    subversion/trunk/subversion/libsvn_subr/svn_string.c

Modified: subversion/trunk/subversion/libsvn_subr/svn_string.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/svn_string.c?rev=1228604&r1=1228603&r2=1228604&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/svn_string.c (original)
+++ subversion/trunk/subversion/libsvn_subr/svn_string.c Sat Jan  7 12:30:18 2012
@@ -724,6 +724,10 @@ svn_cstring_tokenize(const char *sep, ch
     const char * next;
     char csep;
 
+    /* check parameters */
+    if ((sep == NULL) || (str == NULL) || (*str == NULL))
+        return NULL;
+
     /* let APR handle edge cases and multiple separators */
     csep = *sep;
     if (csep == '\0' || sep[1] != '\0')



Mime
View raw message