Since commit 843b7cb ("MEDIUM: chunks: make the chunk struct's fields
match the buffer struct") a chunk length is unsigned so we can't reliably
store -1 and check for negative values in the caller. Only one such
location was found in proto_http's http-request auth rules (which cannot
realistically fail).
No backport is needed.
va_start(argp, fmt);
ret = vsnprintf(chk->area, chk->size, fmt, argp);
va_end(argp);
- chk->data = ret;
if (ret >= chk->size)
- ret = -1;
+ return -1;
chk->data = ret;
return chk->data;
}
if (sess->fe->header_unique_id && s->unique_id) {
- chunk_printf(&trash, "%s: %s", sess->fe->header_unique_id, s->unique_id);
- if (trash.data < 0)
+ if (chunk_printf(&trash, "%s: %s", sess->fe->header_unique_id, s->unique_id) < 0)
goto return_bad_req;
if (unlikely(http_header_add_tail2(&txn->req, &txn->hdr_idx, trash.area, trash.data) < 0))
goto return_bad_req;