diff options
author | Rainer Jung <rjung@apache.org> | 2012-08-16 18:05:21 +0200 |
---|---|---|
committer | Rainer Jung <rjung@apache.org> | 2012-08-16 18:05:21 +0200 |
commit | 212cf7938c3aa2a90778ef8e95433c7a82280bf0 (patch) | |
tree | 111f80aa8199df6a6e76cd9f2012ceb2e2438dda /modules | |
parent | Wrong content type and character set when (diff) | |
download | apache2-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')
-rw-r--r-- | modules/proxy/ajp_msg.c | 9 |
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; |