]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUILD: ssl_sock: fix null dereference for QUIC build
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Mon, 17 Oct 2022 16:46:49 +0000 (18:46 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Mon, 17 Oct 2022 16:58:09 +0000 (18:58 +0200)
commitba303deadc3249e6df111c70eab23007244ed0bb
tree38829d026adaee93fc0ed315152027eecdab20b0
parent74a9eb5216641b2b0d4ae6a96906fc4a36a90b6c
BUILD: ssl_sock: fix null dereference for QUIC build

A previous commit tries to fix uninitialized GCC warning on ssl code for
QUIC build. See the fix here :
  48e46f98ccf97427995eb41c6f28cc38705bdd7e
  BUILD: ssl_sock: bind_conf uninitialized in ssl_sock_bind_verifycbk()

However, this is incomplete as it still reports possible NULL
dereference on ctx variable (GCC v12.2.0). Here is the compilation
result :

  src/ssl_sock.c: In function ‘ssl_sock_bind_verifycbk’:
  src/ssl_sock.c:1739:12: error: potential null pointer dereference [-Werror=null-dereference]
   1739 |         ctx->xprt_st |= SSL_SOCK_ST_FL_VERIFY_DONE;
        |

To fix this, remove check on qc which can also never happens and replace
it with a BUG_ON. This seems to satisfy GCC on my machine.

This must be backported up to 2.6.
src/ssl_sock.c