httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wr...@apache.org
Subject svn commit: r608933 - /httpd/mod_ftp/trunk/modules/ftp/ftp_commands.c
Date Fri, 04 Jan 2008 17:26:21 GMT
Author: wrowe
Date: Fri Jan  4 09:26:19 2008
New Revision: 608933

URL: http://svn.apache.org/viewvc?rev=608933&view=rev
Log:
Solve missing APR 0.9 function apr_strtoff, at least do a mild
sanity check that we have numeric input.  We won't catch overflow
without APR 1 or later.  Observed by Guenter Knauf.

Modified:
    httpd/mod_ftp/trunk/modules/ftp/ftp_commands.c

Modified: httpd/mod_ftp/trunk/modules/ftp/ftp_commands.c
URL: http://svn.apache.org/viewvc/httpd/mod_ftp/trunk/modules/ftp/ftp_commands.c?rev=608933&r1=608932&r2=608933&view=diff
==============================================================================
--- httpd/mod_ftp/trunk/modules/ftp/ftp_commands.c (original)
+++ httpd/mod_ftp/trunk/modules/ftp/ftp_commands.c Fri Jan  4 09:26:19 2008
@@ -2028,9 +2028,15 @@
     char *endp;
     apr_status_t rv;
 
+#if APR_MAJOR_VERSION < 1
+    fc->restart_point = apr_atoi64(arg);
+    endp = (char*)arg + strspn(arg, "0123456789");
+    if (
+#else
     rv = apr_strtoff(&(fc->restart_point), arg, &endp, 10);
-    if (rv != APR_SUCCESS || ((*arg == '\0') || (*endp != '\0')) || 
-            fc->restart_point < 0) 
+    if ((rv != APR_SUCCESS) ||
+#endif
+        (*arg == '\0') || (*endp != '\0') || (fc->restart_point < 0))
     {
         fc->response_notes = apr_pstrdup(r->pool, "REST requires a "
                                          "non-negative integer value");



Mime
View raw message