case sw_value:
st->value += (uint64_t) (ch & 0x7f) << st->shift;
+
+ if (st->shift == 56
+ && ((ch & 0x80) || (st->value & 0xc000000000000000)))
+ {
+ ngx_log_error(NGX_LOG_INFO, c->log, 0,
+ "client exceeded integer size limit");
+ return NGX_HTTP_V3_ERR_EXCESSIVE_LOAD;
+ }
+
if (ch & 0x80) {
st->shift += 7;
break;
case sw_req_insert_count:
- if (ngx_http_v3_parse_prefix_int(c, &st->pint, 8, ch) != NGX_DONE) {
- break;
+ rc = ngx_http_v3_parse_prefix_int(c, &st->pint, 8, ch);
+ if (rc != NGX_DONE) {
+ return rc;
}
st->insert_count = st->pint.value;
case sw_read_delta_base:
- if (ngx_http_v3_parse_prefix_int(c, &st->pint, 7, ch) != NGX_DONE) {
- break;
+ rc = ngx_http_v3_parse_prefix_int(c, &st->pint, 7, ch);
+ if (rc != NGX_DONE) {
+ return rc;
}
st->delta_base = st->pint.value;
case sw_index:
- if (ngx_http_v3_parse_prefix_int(c, &st->pint, 6, ch) != NGX_DONE) {
- break;
+ rc = ngx_http_v3_parse_prefix_int(c, &st->pint, 6, ch);
+ if (rc != NGX_DONE) {
+ return rc;
}
st->index = st->pint.value;
case sw_index:
- if (ngx_http_v3_parse_prefix_int(c, &st->pint, 4, ch) != NGX_DONE) {
- break;
+ rc = ngx_http_v3_parse_prefix_int(c, &st->pint, 4, ch);
+ if (rc != NGX_DONE) {
+ return rc;
}
st->index = st->pint.value;
case sw_read_value_len:
- if (ngx_http_v3_parse_prefix_int(c, &st->pint, 7, ch) != NGX_DONE) {
- break;
+ rc = ngx_http_v3_parse_prefix_int(c, &st->pint, 7, ch);
+ if (rc != NGX_DONE) {
+ return rc;
}
st->literal.length = st->pint.value;
case sw_name_len:
- if (ngx_http_v3_parse_prefix_int(c, &st->pint, 3, ch) != NGX_DONE) {
- break;
+ rc = ngx_http_v3_parse_prefix_int(c, &st->pint, 3, ch);
+ if (rc != NGX_DONE) {
+ return rc;
}
st->literal.length = st->pint.value;
case sw_read_value_len:
- if (ngx_http_v3_parse_prefix_int(c, &st->pint, 7, ch) != NGX_DONE) {
- break;
+ rc = ngx_http_v3_parse_prefix_int(c, &st->pint, 7, ch);
+ if (rc != NGX_DONE) {
+ return rc;
}
st->literal.length = st->pint.value;
case sw_index:
- if (ngx_http_v3_parse_prefix_int(c, &st->pint, 4, ch) != NGX_DONE) {
- break;
+ rc = ngx_http_v3_parse_prefix_int(c, &st->pint, 4, ch);
+ if (rc != NGX_DONE) {
+ return rc;
}
st->index = st->pint.value;
case sw_index:
- if (ngx_http_v3_parse_prefix_int(c, &st->pint, 3, ch) != NGX_DONE) {
- break;
+ rc = ngx_http_v3_parse_prefix_int(c, &st->pint, 3, ch);
+ if (rc != NGX_DONE) {
+ return rc;
}
st->index = st->pint.value;
case sw_read_value_len:
- if (ngx_http_v3_parse_prefix_int(c, &st->pint, 7, ch) != NGX_DONE) {
- break;
+ rc = ngx_http_v3_parse_prefix_int(c, &st->pint, 7, ch);
+ if (rc != NGX_DONE) {
+ return rc;
}
st->literal.length = st->pint.value;
case sw_capacity:
- if (ngx_http_v3_parse_prefix_int(c, &st->pint, 5, ch) != NGX_DONE) {
- break;
+ rc = ngx_http_v3_parse_prefix_int(c, &st->pint, 5, ch);
+ if (rc != NGX_DONE) {
+ return rc;
}
rc = ngx_http_v3_set_capacity(c, st->pint.value);
case sw_duplicate:
- if (ngx_http_v3_parse_prefix_int(c, &st->pint, 5, ch) != NGX_DONE) {
- break;
+ rc = ngx_http_v3_parse_prefix_int(c, &st->pint, 5, ch);
+ if (rc != NGX_DONE) {
+ return rc;
}
rc = ngx_http_v3_duplicate(c, st->pint.value);
case sw_name_index:
- if (ngx_http_v3_parse_prefix_int(c, &st->pint, 6, ch) != NGX_DONE) {
- break;
+ rc = ngx_http_v3_parse_prefix_int(c, &st->pint, 6, ch);
+ if (rc != NGX_DONE) {
+ return rc;
}
st->index = st->pint.value;
case sw_read_value_len:
- if (ngx_http_v3_parse_prefix_int(c, &st->pint, 7, ch) != NGX_DONE) {
- break;
+ rc = ngx_http_v3_parse_prefix_int(c, &st->pint, 7, ch);
+ if (rc != NGX_DONE) {
+ return rc;
}
st->literal.length = st->pint.value;
case sw_name_len:
- if (ngx_http_v3_parse_prefix_int(c, &st->pint, 5, ch) != NGX_DONE) {
- break;
+ rc = ngx_http_v3_parse_prefix_int(c, &st->pint, 5, ch);
+ if (rc != NGX_DONE) {
+ return rc;
}
st->literal.length = st->pint.value;
case sw_read_value_len:
- if (ngx_http_v3_parse_prefix_int(c, &st->pint, 7, ch) != NGX_DONE) {
- break;
+ rc = ngx_http_v3_parse_prefix_int(c, &st->pint, 7, ch);
+ if (rc != NGX_DONE) {
+ return rc;
}
st->literal.length = st->pint.value;
case sw_ack_header:
- if (ngx_http_v3_parse_prefix_int(c, &st->pint, 7, ch) != NGX_DONE) {
- break;
+ rc = ngx_http_v3_parse_prefix_int(c, &st->pint, 7, ch);
+ if (rc != NGX_DONE) {
+ return rc;
}
rc = ngx_http_v3_ack_header(c, st->pint.value);
case sw_cancel_stream:
- if (ngx_http_v3_parse_prefix_int(c, &st->pint, 6, ch) != NGX_DONE) {
- break;
+ rc = ngx_http_v3_parse_prefix_int(c, &st->pint, 6, ch);
+ if (rc != NGX_DONE) {
+ return rc;
}
rc = ngx_http_v3_cancel_stream(c, st->pint.value);
case sw_inc_insert_count:
- if (ngx_http_v3_parse_prefix_int(c, &st->pint, 6, ch) != NGX_DONE) {
- break;
+ rc = ngx_http_v3_parse_prefix_int(c, &st->pint, 6, ch);
+ if (rc != NGX_DONE) {
+ return rc;
}
rc = ngx_http_v3_inc_insert_count(c, st->pint.value);