]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Fix VERSION_STR printf() calls in case the postfix strings include %
authorDidier Raboud <odyx@debian.org>
Sun, 16 Feb 2020 15:14:54 +0000 (16:14 +0100)
committerJouni Malinen <j@w1.fi>
Mon, 17 Feb 2020 17:17:10 +0000 (19:17 +0200)
Do not use VERSION_STR directly as the format string to printf() since
it is possible for that string to contain '%'.

Signed-off-by: Didier Raboud <odyx@debian.org>
hostapd/main.c
hs20/server/hs20_spp_server.c
wpa_supplicant/eapol_test.c
wpa_supplicant/wpa_priv.c
wpa_supplicant/wpa_supplicant.c

index d3657fcfadbfa2fc9d201e5b39e03df319974966..4af8e8f9c7aeeecbaa6e625ed5a55f71fb2acfd2 100644 (file)
@@ -450,11 +450,12 @@ static int hostapd_global_run(struct hapd_interfaces *ifaces, int daemonize,
 static void show_version(void)
 {
        fprintf(stderr,
-               "hostapd v" VERSION_STR "\n"
+               "hostapd v%s\n"
                "User space daemon for IEEE 802.11 AP management,\n"
                "IEEE 802.1X/WPA/WPA2/EAP/RADIUS Authenticator\n"
                "Copyright (c) 2002-2019, Jouni Malinen <j@w1.fi> "
-               "and contributors\n");
+               "and contributors\n",
+               VERSION_STR);
 }
 
 
index 6c74f541d539c1e1dcabb9c9bd095906812f908a..347c40a73d6aac16df127a9045aea27a8023676c 100644 (file)
@@ -176,7 +176,7 @@ int main(int argc, char *argv[])
                        ctx.root_dir = optarg;
                        break;
                case 'v':
-                       printf("hs20_spp_server v" VERSION_STR "\n");
+                       printf("hs20_spp_server v%s\n", VERSION_STR);
                        return 0;
                default:
                        usage();
index 53d75853bdf66da773a62886cedd325cc7168ee7..2fa4968130e7e13c40cfab37f70499668f300bf1 100644 (file)
@@ -1390,7 +1390,7 @@ int main(int argc, char *argv[])
                        eapol_test.ctrl_iface = 1;
                        break;
                case 'v':
-                       printf("eapol_test v" VERSION_STR "\n");
+                       printf("eapol_test v%s\n", VERSION_STR);
                        return 0;
                case 'W':
                        wait_for_monitor++;
index f42840610cf4249f6595fbf290a1d3d588903f2f..c9bcf13fe291168b355165eb5ce7c2879a3f57ea 100644 (file)
@@ -1189,14 +1189,15 @@ static void wpa_priv_fd_workaround(void)
 
 static void usage(void)
 {
-       printf("wpa_priv v" VERSION_STR "\n"
+       printf("wpa_priv v%s\n"
               "Copyright (c) 2007-2017, Jouni Malinen <j@w1.fi> and "
               "contributors\n"
               "\n"
               "usage:\n"
               "  wpa_priv [-Bdd] [-c<ctrl dir>] [-P<pid file>] "
               "<driver:ifname> \\\n"
-              "           [driver:ifname ...]\n");
+              "           [driver:ifname ...]\n",
+              VERSION_STR);
 }
 
 
index e4449d4da2a983cd365203d31c338deada7ede0d..7e06a22f6806176214e58480a43b2666c0d381e8 100644 (file)
@@ -6817,7 +6817,7 @@ struct wpa_global * wpa_supplicant_init(struct wpa_params *params)
        wpa_debug_timestamp = global->params.wpa_debug_timestamp =
                params->wpa_debug_timestamp;
 
-       wpa_printf(MSG_DEBUG, "wpa_supplicant v" VERSION_STR);
+       wpa_printf(MSG_DEBUG, "wpa_supplicant v%s", VERSION_STR);
 
        if (eloop_init()) {
                wpa_printf(MSG_ERROR, "Failed to initialize event loop");