]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUILD: htx: use the unchecked version of htx_get_head_blk() where needed
authorWilly Tarreau <w@1wt.eu>
Mon, 30 May 2022 14:27:48 +0000 (16:27 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 30 May 2022 14:27:48 +0000 (16:27 +0200)
stream.c and mux_fcgi.c may cause a warning for a possible NULL deref
at -Os, while that is not possible thanks to the previous test. Let's
just switch to __htx_get_head_blk() instead.

src/mux_fcgi.c
src/stream.c

index 26240cf940cf3ced051524a8e207bb127bb2c032..bb9ec5667707177f6793d2b3185fa7e8a3dace1d 100644 (file)
@@ -462,7 +462,7 @@ static void fcgi_trace(enum trace_level level, uint64_t mask, const struct trace
 
        /* Display status-line if possible (verbosity > MINIMAL) */
        if (src->verbosity > FCGI_VERB_MINIMAL && htx && htx_nbblks(htx)) {
-               const struct htx_blk *blk = htx_get_head_blk(htx);
+               const struct htx_blk *blk = __htx_get_head_blk(htx);
                const struct htx_sl  *sl  = htx_get_blk_ptr(htx, blk);
                enum htx_blk_type    type = htx_get_blk_type(blk);
 
index e20ac9867d0279e5182ccc800ae1930dcd4c7713..f3f776db624b50469d10e056f4f5522b617839cc 100644 (file)
@@ -187,7 +187,7 @@ static void strm_trace(enum trace_level level, uint64_t mask, const struct trace
 
        /* If msg defined, display status-line if possible (verbosity > MINIMAL) */
        if (src->verbosity > STRM_VERB_MINIMAL && htx && htx_nbblks(htx)) {
-               const struct htx_blk *blk = htx_get_head_blk(htx);
+               const struct htx_blk *blk = __htx_get_head_blk(htx);
                const struct htx_sl  *sl  = htx_get_blk_ptr(htx, blk);
                enum htx_blk_type    type = htx_get_blk_type(blk);