Fix buf_t advancement in fetch_buf_from_socks

We pullup 512 bytes of input to make sure that at least one SOCKS
message ends up in head of linked list
This commit is contained in:
rl1987
2018-05-23 11:44:43 +02:00
committed by Nick Mathewson
parent 01cf3007b5
commit 58cb2ed243
2 changed files with 13 additions and 15 deletions
+2 -2
View File
@@ -142,7 +142,7 @@ test_socks_4_bad_arguments(void *ptr)
get_options()->SafeSocks),
OP_EQ, -1);
buf_clear(buf);
expect_log_msg_containing("Port or DestIP is zero."); // !!!
expect_log_msg_containing("Port or DestIP is zero.");
mock_clean_saved_logs();
/* Try with 0 port */
@@ -164,7 +164,7 @@ test_socks_4_bad_arguments(void *ptr)
tt_int_op(fetch_from_buf_socks(buf, socks, 1, 0),
OP_EQ, -1);
buf_clear(buf);
expect_log_msg_containing("user name too long; rejecting.");
expect_log_msg_containing("socks4: parsing failed - invalid request.");
mock_clean_saved_logs();
/* Try with 2000-byte hostname */