Discussion:
svn commit: r1629970 - /httpd/mod_ftp/trunk/modules/ftp/ftp_commands.c
w***@apache.org
2014-10-07 19:48:41 UTC
Permalink
Author: wrowe
Date: Tue Oct 7 19:48:40 2014
New Revision: 1629970

URL: http://svn.apache.org/r1629970
Log:
Quite an error in what's actually a NOOP at the present time

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=1629970&r1=1629969&r2=1629970&view=diff
==============================================================================
--- httpd/mod_ftp/trunk/modules/ftp/ftp_commands.c (original)
+++ httpd/mod_ftp/trunk/modules/ftp/ftp_commands.c Tue Oct 7 19:48:40 2014
@@ -1680,6 +1680,7 @@ static int ftp_cmd_pasv(request_rec *r,
static int ftp_cmd_pbsz(request_rec *r, const char *arg)
{
ftp_connection *fc = ftp_get_module_config(r->connection->conn_config);
+ long val;
char *endp;

/*
@@ -1691,17 +1692,17 @@ static int ftp_cmd_pbsz(request_rec *r,
return FTP_REPLY_BAD_SEQUENCE;
}

- fc->pbsz = strtol(arg, &endp, 10);
+ val = strtol(arg, &endp, 10);
/*
* Return 501 if we were unable to parse the argument or if there was a
* possibility of an overflow
*/
- if (((*arg == '\0') || (*endp != '\0')) || fc->pbsz < 0
- || fc->pbsz == LONG_MAX) {
+ if ((*arg == '\0') || (*endp != '\0') || (val < 0) || (val > INT_MAX)) {
fc->response_notes = "Could not parse PBSZ argument";
return FTP_REPLY_SYNTAX_ERROR;
}

+ fc->pbsz = int(val)
fc->response_notes = apr_psprintf(r->pool, "PBSZ Command OK. "
"Protection buffer size set to %d",
fc->pbsz);

Loading...