selftests: bpf: fix -Wformat-security warning for flow_dissector_load.c
authorStanislav Fomichev <sdf@google.com>
Tue, 2 Apr 2019 17:08:33 +0000 (10:08 -0700)
committerDaniel Borkmann <daniel@iogearbox.net>
Tue, 2 Apr 2019 21:17:18 +0000 (23:17 +0200)
flow_dissector_load.c:55:19: warning: format string is not a string literal (potentially insecure)
      [-Wformat-security]
                error(1, errno, command);
                                ^~~~~~~
flow_dissector_load.c:55:19: note: treat the string as an argument to avoid this
                error(1, errno, command);
                                ^
                                "%s",
1 warning generated.

Signed-off-by: Stanislav Fomichev <sdf@google.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
tools/testing/selftests/bpf/flow_dissector_load.c

index 77cafa66d0487840a81b02871d85f8d6b7082389..7136ab9ffa73a3ebbf6e7ac86199777e94995a4d 100644 (file)
@@ -52,7 +52,7 @@ static void detach_program(void)
        sprintf(command, "rm -r %s", cfg_pin_path);
        ret = system(command);
        if (ret)
-               error(1, errno, command);
+               error(1, errno, "%s", command);
 }
 
 static void parse_opts(int argc, char **argv)