subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r995824 - /subversion/trunk/subversion/libsvn_subr/svn_string.c
Date Fri, 10 Sep 2010 15:19:36 GMT
Author: stsp
Date: Fri Sep 10 15:19:35 2010
New Revision: 995824

URL: http://svn.apache.org/viewvc?rev=995824&view=rev
Log:
* subversion/libsvn_subr/svn_string.
  (svn_cstring_strtoui64): Add casts to force an unsigned comparison,
   in case the compiler gets it wrong and interprets minval/maxval as signed.

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=995824&r1=995823&r2=995824&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/svn_string.c (original)
+++ subversion/trunk/subversion/libsvn_subr/svn_string.c Fri Sep 10 15:19:35 2010
@@ -629,7 +629,7 @@ svn_cstring_strtoui64(apr_uint64_t *n, c
              svn_error_createf(SVN_ERR_INCORRECT_PARAMS, NULL,
                                _("Could not convert '%s' into a number"),
                                str));
-  if (val < 0 || val < minval || val > maxval)
+  if (val < 0 || (apr_uint64_t)val < minval || (apr_uint64_t)val > maxval)
     return svn_error_return(
              svn_error_createf(SVN_ERR_INCORRECT_PARAMS, NULL,
                                _("Number '%s' is out of range"), str));



Mime
View raw message