subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bre...@apache.org
Subject svn commit: r1455375 - /subversion/trunk/subversion/libsvn_subr/utf_validate.c
Date Tue, 12 Mar 2013 00:41:27 GMT
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)



Mime
View raw message