mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-06 23:27:04 +02:00
MINOR: log/cbor: _lf_cbor_encode_byte() explicitly requires non-NULL ctx (again)
The BUG_ON() statement that was added in 9bdea51
("MINOR: log/cbor:
_lf_cbor_encode_byte() explicitly requires non-NULL ctx") isn't
sufficient as Coverity still thinks the lf_buildctx itself may be NULL
as shown in GH #2554. In fact the original reports complains about the
lf_buildctx itself and I didn't understand it properly, let's add another
check in the BUG_ON() to ensure both cbor_ctx and cbor_ctx->ctx are not
NULL since it is not expected if used properly.
This commit is contained in:
parent
9931a62c3f
commit
41d7e82e0f
@ -1794,7 +1794,7 @@ static char *_lf_cbor_encode_byte(struct cbor_encode_ctx *cbor_ctx,
|
|||||||
{
|
{
|
||||||
struct lf_buildctx *ctx;
|
struct lf_buildctx *ctx;
|
||||||
|
|
||||||
BUG_ON(!cbor_ctx);
|
BUG_ON(!cbor_ctx || !cbor_ctx->e_fct_ctx);
|
||||||
ctx = cbor_ctx->e_fct_ctx;
|
ctx = cbor_ctx->e_fct_ctx;
|
||||||
|
|
||||||
if (ctx->options & LOG_OPT_BIN) {
|
if (ctx->options & LOG_OPT_BIN) {
|
||||||
|
Loading…
Reference in New Issue
Block a user