Skip to content

Commit 250fa4a

Browse files
committed
fix ajp_msg_get_string buffer checks
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1933342 13f79535-47bb-0310-9956-ffa450edef68
1 parent 17e874e commit 250fa4a

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

modules/proxy/ajp_msg.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,12 @@ apr_status_t ajp_msg_get_string(ajp_msg_t *msg, const char **rvalue)
507507
status = ajp_msg_get_uint16(msg, &size);
508508
start = msg->pos;
509509

510-
if ((status != APR_SUCCESS) || (size + start > msg->max_size)) {
510+
if ((status != APR_SUCCESS) || (size + start >= msg->len)) {
511+
return ajp_log_overflow(msg, "ajp_msg_get_string");
512+
}
513+
514+
/* Verify that the expected null terminator is actually present */
515+
if (msg->buf[start + size] != '\0') {
511516
return ajp_log_overflow(msg, "ajp_msg_get_string");
512517
}
513518

0 commit comments

Comments
 (0)