summaryrefslogtreecommitdiffstats
path: root/modules/proxy/ajp_msg.c
diff options
context:
space:
mode:
authorRainer Jung <rjung@apache.org>2012-08-16 18:05:21 +0200
committerRainer Jung <rjung@apache.org>2012-08-16 18:05:21 +0200
commit212cf7938c3aa2a90778ef8e95433c7a82280bf0 (patch)
tree111f80aa8199df6a6e76cd9f2012ceb2e2438dda /modules/proxy/ajp_msg.c
parentWrong content type and character set when (diff)
downloadapache2-212cf7938c3aa2a90778ef8e95433c7a82280bf0.tar.xz
apache2-212cf7938c3aa2a90778ef8e95433c7a82280bf0.zip
Fix crash in packet dump code of mod_proxy_ajp when
logging with LogLevel trace7 or trace8. PR 53730 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1373898 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'modules/proxy/ajp_msg.c')
-rw-r--r--modules/proxy/ajp_msg.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/modules/proxy/ajp_msg.c b/modules/proxy/ajp_msg.c
index 638dfee2d8..71bc1dd902 100644
--- a/modules/proxy/ajp_msg.c
+++ b/modules/proxy/ajp_msg.c
@@ -21,9 +21,11 @@ APLOG_USE_MODULE(proxy_ajp);
#define AJP_MSG_DUMP_BYTES_PER_LINE 16
/* 2 hex digits plus space plus one char per dumped byte */
/* plus prefix plus separator plus '\0' */
-#define AJP_MSG_DUMP_LINE_LENGTH (strlen("XX .") + \
- strlen("XXXX ") + \
- strlen(" - ") + 1)
+#define AJP_MSG_DUMP_PREFIX_LENGTH strlen("XXXX ")
+#define AJP_MSG_DUMP_LINE_LENGTH ((AJP_MSG_DUMP_BYTES_PER_LINE * \
+ strlen("XX .")) + \
+ AJP_MSG_DUMP_PREFIX_LENGTH + \
+ strlen(" - ") + 1)
static char *hex_table = "0123456789ABCDEF";
@@ -70,6 +72,7 @@ apr_status_t ajp_msg_dump(apr_pool_t *pool, ajp_msg_t *msg, char *err,
return APR_ENOMEM;
}
apr_snprintf(current, rl, "%.4lx ", (unsigned long)i);
+ current += AJP_MSG_DUMP_PREFIX_LENGTH;
line_len = len - i;
if (line_len > AJP_MSG_DUMP_BYTES_PER_LINE) {
line_len = AJP_MSG_DUMP_BYTES_PER_LINE;