You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by br...@apache.org on 2013/03/12 01:41:27 UTC

svn commit: r1455375 - /subversion/trunk/subversion/libsvn_subr/utf_validate.c

Author: breser
Date: Tue Mar 12 00:41:27 2013
New Revision: 1455375

URL: http://svn.apache.org/r1455375
Log:
Check that the pointer to the string is not NULL for svn_utf__*_is_valid().

* subversion/libsvn_subr/utf_validate.c
  (svn_utf__cstring_is_valid, svn_utf__is_valid): Check data input before
    using it.  If it's NULL then return FALSE because it's not a valid
    string.

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

Modified: subversion/trunk/subversion/libsvn_subr/utf_validate.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/utf_validate.c?rev=1455375&r1=1455374&r2=1455375&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/utf_validate.c (original)
+++ subversion/trunk/subversion/libsvn_subr/utf_validate.c Tue Mar 12 00:41:27 2013
@@ -352,6 +352,10 @@ svn_boolean_t
 svn_utf__cstring_is_valid(const char *data)
 {
   int state = FSM_START;
+
+  if (!data)
+    return FALSE;
+
   data = first_non_fsm_start_char_cstring(data);
 
   while (*data)
@@ -368,6 +372,10 @@ svn_utf__is_valid(const char *data, apr_
 {
   const char *end = data + len;
   int state = FSM_START;
+
+  if (!data)
+    return FALSE;
+
   data = first_non_fsm_start_char(data, len);
 
   while (data < end)