Skip to content

Commit d7280c6

Browse files
committed
Fixed NGINX compilation issues
1 parent 8560642 commit d7280c6

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

CHANGES

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
* Fixed bug when use ctl:ruleRemoveTargetByTag.
2727

28-
* Fixed many IIS port bugs.
28+
* Fixed IIS and NGINX modules bugs.
2929

3030
* Fixed bug when @strmatch patterns use invalid escape sequence (Thanks Hideaki Hayashi).
3131

nginx/modsecurity/ngx_http_modsecurity.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -488,6 +488,9 @@ ngx_http_do_read_upload_client_request_body(ngx_http_request_t *r)
488488
if (rb->buf->last == rb->buf->end) {
489489

490490
rc = ngx_http_process_request_body(r, rb->to_write);
491+
if(rc != NGX_OK) {
492+
return rc;
493+
}
491494

492495
rb->to_write = rb->bufs->next ? rb->bufs->next : rb->bufs;
493496
rb->buf->last = rb->buf->start;
@@ -555,7 +558,10 @@ ngx_http_do_read_upload_client_request_body(ngx_http_request_t *r)
555558
ngx_del_timer(c->read);
556559
}
557560

558-
ngx_http_process_request_body(r, rb->to_write);
561+
rc = ngx_http_process_request_body(r, rb->to_write);
562+
if(rc != NGX_OK) {
563+
return rc;
564+
}
559565

560566
return ngx_http_upload_body_handler(r);
561567
}
@@ -779,7 +785,7 @@ modsecurity_read_body_cb(request_rec *r, char *buf, unsigned int length,
779785
if (!ctx->body_pos) {
780786
ctx->body_pos = b->start;
781787
}
782-
if ((b->end - ctx->body_pos) > length) {
788+
if ((unsigned int)(b->end - ctx->body_pos) > length) {
783789
ngx_memcpy(buf, (char *) ctx->body_pos, length);
784790
ctx->processed += length;
785791
ctx->body_pos += length;

0 commit comments

Comments
 (0)