Skip to content

Commit 493eb23

Browse files
committed
Merge r1933340 from trunk:
fix length checks in AJP msg_get functions git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1933341 13f79535-47bb-0310-9956-ffa450edef68
1 parent f89a617 commit 493eb23

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

modules/proxy/ajp_msg.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ apr_status_t ajp_msg_get_uint32(ajp_msg_t *msg, apr_uint32_t *rvalue)
395395
{
396396
apr_uint32_t value;
397397

398-
if ((msg->pos + 3) > msg->len) {
398+
if ((msg->pos + 3) >= msg->len) {
399399
return ajp_log_overflow(msg, "ajp_msg_get_uint32");
400400
}
401401

@@ -420,7 +420,7 @@ apr_status_t ajp_msg_get_uint16(ajp_msg_t *msg, apr_uint16_t *rvalue)
420420
{
421421
apr_uint16_t value;
422422

423-
if ((msg->pos + 1) > msg->len) {
423+
if ((msg->pos + 1) >= msg->len) {
424424
return ajp_log_overflow(msg, "ajp_msg_get_uint16");
425425
}
426426

@@ -443,7 +443,7 @@ apr_status_t ajp_msg_peek_uint16(ajp_msg_t *msg, apr_uint16_t *rvalue)
443443
{
444444
apr_uint16_t value;
445445

446-
if ((msg->pos + 1) > msg->len) {
446+
if ((msg->pos + 1) >= msg->len) {
447447
return ajp_log_overflow(msg, "ajp_msg_peek_uint16");
448448
}
449449

@@ -464,7 +464,7 @@ apr_status_t ajp_msg_peek_uint16(ajp_msg_t *msg, apr_uint16_t *rvalue)
464464
*/
465465
apr_status_t ajp_msg_peek_uint8(ajp_msg_t *msg, apr_byte_t *rvalue)
466466
{
467-
if (msg->pos > msg->len) {
467+
if (msg->pos >= msg->len) {
468468
return ajp_log_overflow(msg, "ajp_msg_peek_uint8");
469469
}
470470

@@ -482,7 +482,7 @@ apr_status_t ajp_msg_peek_uint8(ajp_msg_t *msg, apr_byte_t *rvalue)
482482
apr_status_t ajp_msg_get_uint8(ajp_msg_t *msg, apr_byte_t *rvalue)
483483
{
484484

485-
if (msg->pos > msg->len) {
485+
if (msg->pos >= msg->len) {
486486
return ajp_log_overflow(msg, "ajp_msg_get_uint8");
487487
}
488488

0 commit comments

Comments
 (0)