mod_proxy_ftp: NULL pointer dereference on error paths.
[Stefan Fritsch <sf fritsch.de>, Joe Orton]
- *) mod_socache_shmcb: Only parse cache size in parens at the end of the
- string. Fixes SSLSessionCache directive mis-parsing parens in pathname.
+ *) mod_socache_shmcb: Allow parens in file name if cache size is given.
+ Fixes SSLSessionCache directive mis-parsing parens in pathname.
PR 47945. [Stefan Fritsch]
*) htpasswd: Improve out of disk space handling. PR 30877. [Stefan Fritsch]
cp = strrchr(path, '(');
cp2 = path + strlen(path) - 1;
- if (cp && (*cp2 == ')')) {
+ if (cp) {
+ char *endptr;
+ if (*cp2 != ')') {
+ return "Invalid argument: no closing parenthesis or cache size "
+ "missing after pathname with parenthesis";
+ }
*cp++ = '\0';
*cp2 = '\0';
- ctx->shm_size = atoi(cp);
+
+ ctx->shm_size = strtol(cp, &endptr, 10);
+ if (endptr != cp2) {
+ return "Invalid argument: cache size not numerical";
+ }
if (ctx->shm_size < 8192) {
return "Invalid argument: size has to be >= 8192 bytes";
}
}
+ else if (cp2 >= path && *cp2 == ')') {
+ return "Invalid argument: no opening parenthesis";
+ }
return NULL;
}