mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-12-06 19:41:15 +01:00
Add some functions to escape values from the network before sending them to the log. Use them everywhere except for routerinfo->plaftorm, routerinfo->contact_info, and rend*.c. (need sleep now)
svn:r6087
This commit is contained in:
@@ -913,6 +913,12 @@ test_util(void)
|
||||
test_streq(tmpbuf, "18.244.0.188");
|
||||
}
|
||||
|
||||
/* Test 'escaped' */
|
||||
test_streq("\"\"", escaped(""));
|
||||
test_streq("\"abcd\"", escaped("abcd"));
|
||||
test_streq("\"\\\\\\n\\r\\t\\\"\\'\"", escaped("\\\n\r\t\"\'"));
|
||||
test_streq("\"z\\001abc\\277d\"", escaped("z\001abc\277d"));
|
||||
|
||||
/* XXXX test older functions. */
|
||||
smartlist_free(sl);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user