]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: ssl: Stop passing dynamic strings as format arguments
authorTim Duesterhus <tim@bastelstu.be>
Wed, 19 Feb 2020 10:41:13 +0000 (11:41 +0100)
committerWilliam Lallemand <wlallemand@haproxy.org>
Wed, 19 Feb 2020 10:46:18 +0000 (11:46 +0100)
gcc complains rightfully:

src/ssl_sock.c: In function ‘ssl_load_global_issuers_from_path’:
src/ssl_sock.c:9860:4: warning: format not a string literal and no format arguments [-Wformat-security]
    ha_warning(warn);
    ^

Introduced in 70df7bf19cebd5593c0abb01923e6c9f72961da6.

src/ssl_sock.c

index e30bb8a6c8b734a04a8090889c588f72ff4e15e3..ade5ffc84d993c04c17fd3f88a65f6b32d048984 100644 (file)
@@ -9857,7 +9857,7 @@ static int ssl_load_global_issuers_from_path(char **args, int section_type, stru
                        goto next;
                ssl_load_global_issuer_from_BIO(in, fp, &warn);
                if (warn) {
-                       ha_warning(warn);
+                       ha_warning("%s", warn);
                        free(warn);
                        warn = NULL;
                }