]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUILD: http-htx: Silent build error about a possible NULL start-line
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 22 Nov 2022 17:02:00 +0000 (18:02 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Tue, 22 Nov 2022 17:02:02 +0000 (18:02 +0100)
commit92c2de1a06a5d2be4f498503fa09372256339c8b
tree2b852b9d05b24e2dd8c4ccd5da7d91ff09714752
parenta462ee0af4fa5e3172897edcfc532a5c4991dafa
BUILD: http-htx: Silent build error about a possible NULL start-line

In http_replace_req_uri(), if the URI was successfully replaced, it means
the start-line exists. However, the compiler reports an error about a
possible NULL pointer dereference:

src/http_htx.c: In function ‘http_replace_req_uri’:
src/http_htx.c:392:19: error: potential null pointer dereference [-Werror=null-dereference]
  392 |         sl->flags &= ~HTX_SL_F_NORMALIZED_URI;

So, ALREADY_CHECKED() macro is used to silent the build error. This patch
must be backported with 84cdbe478a ("BUG/MINOR: http-htx: Don't consider an
URI as normalized after a set-uri action").
src/http_htx.c