git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@610111
13f79535-47bb-0310-9956-
ffa450edef68
int linelimit)
{
apr_size_t len;
+ int tmp_len;
apr_status_t rv;
- len = sizeof(ctx->chunk_ln) - (ctx->pos - ctx->chunk_ln) - 1;
+ tmp_len = sizeof(ctx->chunk_ln) - (ctx->pos - ctx->chunk_ln) - 1;
+ /* Saveguard ourselves against underflows */
+ if (tmp_len < 0) {
+ len = 0;
+ }
+ else {
+ len = (apr_size_t) tmp_len;
+ }
/*
* Check if there is space left in ctx->chunk_ln. If not, then either
* the chunk size is insane or we have chunk-extensions. Ignore both