Correct typo in error message
Unlikely potential memory leak.
Point 12 of PR 54936
Remove <Proxy ~ wildcard-url> syntax which:
- is equivalent to <ProxyMatch wildcard-url>
- has never been documented
- incorrectly checks parameters (!cmd->path should be !cmd->path[0])
- is buggy (! is missing in front of strncasecmp)
Avoid sending back uninitialized memory, use 'ftpmessage' in order to have something meaningful instead.
Save 8k of stack by the same time.
NULL terminate the right buffer
Fix issues found by PVS-Studio static analyzer:
mod_mime_magic:
cut'n'paste error rsl_encoding vs. rsl_separator, also simplify code a bit
mod_header:
wrong string initialization (leading to segfault if format argument is missing)
util_win32: duplicate sizeof (untested; Windows people, please review)
PR: 51542
Submitted by: Andrey Karpov <karpov viva64 com>, Stefan Fritsch
Reviewed by: jailletc36, rpluem, wrowe
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@
1576709 13f79535-47bb-0310-9956-
ffa450edef68
*) mod_proxy_http: Core dumped under high load. PR 50335.
[Jan Kaluza <jkaluza redhat.com>]
+ *) proxy_util: NULL terminate the right buffer in 'send_http_connect'.
+ [Christophe Jaillet]
+
+ *) mod_proxy: Remove (never documented) <Proxy ~ wildcard-url> syntax which
+ is equivalent to <ProxyMatch wildcard-url>. [Christophe Jaillet]
+
+ *) mod_ldap: Fix a potential memory leak or corruption. PR 54936.
+ [Zhenbo Xu <zhenbo1987 gmail com>]
+
*) mod_rewrite: Add mod_rewrite.h to the headers installed on Windows.
PR46679 [Bob Ionescu]
PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
[ start all new proposals below, under PATCHES PROPOSED. ]
- * back port some bugfix that have already been included in 2.4.x. CHANGES has
- been upgraded with the corresponding entries.
- - Correct typo in error message
- - Unlikely potential memory leak. PR 54936
- - Remove <Proxy ~ wildcard-url> syntax which:
- - is equivalent to <ProxyMatch wildcard-url>
- - has never been documented
- - incorrectly checks parameters (!cmd->path should be !cmd->path[0])
- - is buggy (! is missing in front of strncasecmp)
- - Avoid sending back uninitialized memory, use 'ftpmessage' in order to have
- something meaningful instead.
- Save 8k of stack by the same time.
- - NULL terminate the right buffer
- - mod_header: wrong string initialization (leading to segfault if format argument is missing)
- util_win32: duplicate sizeof (untested; Windows people, please review)
- trunk patch: http://svn.apache.org/viewvc?view=revision&revision=r1493330
- http://svn.apache.org/viewvc?view=revision&revision=r1504276
- http://svn.apache.org/viewvc?view=revision&revision=r1552227
- http://svn.apache.org/viewvc?view=revision&revision=r1551714
- http://svn.apache.org/viewvc?view=revision&revision=r1490994
- http://svn.apache.org/viewvc?view=revision&revision=r1172732
- 2.2.x patch: http://people.apache.org/~jailletc36/patch_2.2.diff
- +1: jailletc36, rpluem, wrowe
-
* mod_ssl: Do not perform SNI / Host header comparison in case of a
forward proxy request.
Trunk version of patch:
sec->deref = always;
}
else {
- return "Unrecognized value for AuthLDAPAliasDereference directive";
+ return "Unrecognized value for AuthLDAPDereferenceAliases directive";
}
return NULL;
}
if (node) {
if (!(node->url = util_ald_strdup(cache, n->url))) {
- util_ald_free(cache, node->url);
+ util_ald_free(cache, node);
return NULL;
}
node->search_cache = n->search_cache;
return NULL;
}
- tag->arg = '\0';
+ tag->arg = "\0";
/* grab the argument if there is one */
if (*s == '{') {
++s;
return "Regex could not be compiled";
}
}
- else if (!strcmp(cmd->path, "~")) {
- cmd->path = ap_getword_conf(cmd->pool, &arg);
- if (!cmd->path)
- return "<Proxy ~ > block must specify a path";
- if (strncasecmp(cmd->path, "proxy:", 6))
- cmd->path += 6;
- r = ap_pregcomp(cmd->pool, cmd->path, AP_REG_EXTENDED);
- if (!r) {
- return "Regex could not be compiled";
- }
- }
/* initialize our config and fetch it */
conf = ap_set_config_vectors(cmd->server, new_dir_conf, cmd->path,
apr_bucket_brigade *bb = apr_brigade_create(p, c->bucket_alloc);
char *buf, *connectname;
apr_port_t connectport;
- char buffer[MAX_STRING_LEN];
char *ftpmessage = NULL;
char *path, *strp, *type_suffix, *cwd = NULL;
apr_uri_t uri;
"Error reading from remote server");
}
if (rc != 200) {
- return ftp_proxyerror(r, backend, HTTP_BAD_GATEWAY, buffer);
+ return ftp_proxyerror(r, backend, HTTP_BAD_GATEWAY, ftpmessage);
}
/* signal that we must use the EPRT/PORT loop */
nbytes = sizeof(drain_buffer) - 1;
while (status == APR_SUCCESS && nbytes) {
status = apr_socket_recv(backend->sock, drain_buffer, &nbytes);
- buffer[nbytes] = '\0';
+ drain_buffer[nbytes] = '\0';
nbytes = sizeof(drain_buffer) - 1;
if (strstr(drain_buffer, "\r\n\r\n") != NULL) {
complete = 1;
PSECURITY_ATTRIBUTES sa;
sa = (PSECURITY_ATTRIBUTES) LocalAlloc(LPTR, sizeof(SECURITY_ATTRIBUTES));
- sa->nLength = sizeof(sizeof(SECURITY_ATTRIBUTES));
+ sa->nLength = sizeof(SECURITY_ATTRIBUTES);
pSD = (PSECURITY_DESCRIPTOR) LocalAlloc(LPTR, SECURITY_DESCRIPTOR_MIN_LENGTH);
sa->lpSecurityDescriptor = pSD;