]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Initialize some locals in socks5 parsing code.
authorNick Mathewson <nickm@torproject.org>
Tue, 18 Sep 2018 19:13:10 +0000 (15:13 -0400)
committerNick Mathewson <nickm@torproject.org>
Sun, 14 Oct 2018 19:25:16 +0000 (15:25 -0400)
These confused GCC LTO, which thought they might be used
uninitialized.  I'm pretty sure that as long as 'res' indicates
success, they will always be set to something, but let's unconfuse
the compiler in any case.

src/core/proto/proto_socks.c

index e2f233ad0505cb57e3186d4053ff3c4051042e91..e23da7730b171b29bf28932f522e46ea094ea3bc 100644 (file)
@@ -744,7 +744,7 @@ handle_socks_message(const uint8_t *raw_data, size_t datalen,
       res = SOCKS_RESULT_MORE_EXPECTED;
       goto end;
     } else if (req->socks_version != SOCKS_VER_5) {
-      int have_user_pass, have_no_auth;
+      int have_user_pass=0, have_no_auth=0;
       res = parse_socks5_methods_request(raw_data, req, datalen,
                                          &have_user_pass,
                                          &have_no_auth,