*) mod_proxy: Rename erroronstatus to failonstatus.
[Daniel Ruggeri <DRuggeri primary.net>]
+ *) mod_dav_fs: Fix broken "creationdate" property.
+ Regression in version 2.3.7. [Rainer Jung]
+
+ *) mod_dav, mod_dav_fs: Replace remaining uses of sprintf()
+ by apr_snprintf(). [Rainer Jung]
+
Changes with Apache 2.3.7
*) SECURITY: CVE-2010-1452 (cve.mitre.org)
/* Note: picked up from ap_gm_timestr_822() */
/* NOTE: buf must be at least DAV_TIMEBUF_SIZE chars in size */
-static void dav_format_time(int style, apr_time_t sec, char *buf)
+static void dav_format_time(int style, apr_time_t sec, char *buf, apr_size_t buflen)
{
apr_time_exp_t tms;
/* ### should we use "-00:00" instead of "Z" ?? */
/* 20 chars plus null term */
- apr_snprintf(buf, sizeof(buf), "%.4d-%.2d-%.2dT%.2d:%.2d:%.2dZ",
+ apr_snprintf(buf, buflen, "%.4d-%.2d-%.2dT%.2d:%.2d:%.2dZ",
tms.tm_year + 1900, tms.tm_mon + 1, tms.tm_mday,
tms.tm_hour, tms.tm_min, tms.tm_sec);
return;
/* RFC 822 date format; as strftime '%a, %d %b %Y %T GMT' */
/* 29 chars plus null term */
- sprintf(buf,
- "%s, %.2d %s %d %.2d:%.2d:%.2d GMT",
- apr_day_snames[tms.tm_wday],
- tms.tm_mday, apr_month_snames[tms.tm_mon],
- tms.tm_year + 1900,
- tms.tm_hour, tms.tm_min, tms.tm_sec);
+ apr_snprintf(buf, buflen, "%s, %.2d %s %d %.2d:%.2d:%.2d GMT",
+ apr_day_snames[tms.tm_wday],
+ tms.tm_mday, apr_month_snames[tms.tm_mon],
+ tms.tm_year + 1900,
+ tms.tm_hour, tms.tm_min, tms.tm_sec);
}
/* Copy or move src to dst; src_finfo is used to propagate permissions
*/
dav_format_time(DAV_STYLE_ISO8601,
resource->info->finfo.ctime,
- buf);
+ buf, sizeof(buf));
value = buf;
break;
if (resource->collection)
return DAV_PROP_INSERT_NOTDEF;
- (void) sprintf(buf, "%" APR_OFF_T_FMT, resource->info->finfo.size);
+ apr_snprintf(buf, sizeof(buf), "%" APR_OFF_T_FMT, resource->info->finfo.size);
value = buf;
break;
case DAV_PROPID_getlastmodified:
dav_format_time(DAV_STYLE_RFC822,
resource->info->finfo.mtime,
- buf);
+ buf, sizeof(buf));
value = buf;
break;
#include "apr.h"
#include "apr_strings.h"
-#if APR_HAVE_STDIO_H
-#include <stdio.h> /* for sprintf() */
-#endif
-
#include "mod_dav.h"
#include "http_log.h"
#include "http_config.h"
break;
}
dav_buffer_append(p, pbuf, "</D:lockscope>" DEBUG_CR);
- sprintf(tmp, "<D:depth>%s</D:depth>" DEBUG_CR,
- lock->depth == DAV_INFINITY ? "infinity" : "0");
+ apr_snprintf(tmp, sizeof(tmp), "<D:depth>%s</D:depth>" DEBUG_CR,
+ lock->depth == DAV_INFINITY ? "infinity" : "0");
dav_buffer_append(p, pbuf, tmp);
if (lock->owner) {
}
else {
time_t now = time(NULL);
- sprintf(tmp, "Second-%lu", (long unsigned int)(lock->timeout - now));
+ apr_snprintf(tmp, sizeof(tmp), "Second-%lu", (long unsigned int)(lock->timeout - now));
dav_buffer_append(p, pbuf, tmp);
}