diff options
author | Esteban Manchado Velázquez <emanchado@demiurgo.org> | 2012-02-03 23:28:40 +0100 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2012-03-08 20:49:17 -0500 |
commit | f9ad35c361b4c183a55dec3f9fa7eb728e089730 (patch) | |
tree | 52283463ba29bf1f928bbeb9710d036ca89c08d6 /src/test | |
parent | a753ef8517e02e33cec064394a25e29ea89e6145 (diff) | |
download | tor-f9ad35c361b4c183a55dec3f9fa7eb728e089730.tar.gz tor-f9ad35c361b4c183a55dec3f9fa7eb728e089730.zip |
Add test for broken hex parsing
* The test currently fails, but it's commented out (with an "#if 0")
* As a broken octal actually gives a parse error, it seems fair that this
fails, too
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/test_util.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/test/test_util.c b/src/test/test_util.c index b8c0544c3f..4bcd49f549 100644 --- a/src/test/test_util.c +++ b/src/test/test_util.c @@ -304,6 +304,7 @@ test_util_config_line_escaped_content(void) char buf2[128]; char buf3[128]; char buf4[128]; + char buf5[128]; char *k=NULL, *v=NULL; const char *str; @@ -330,6 +331,9 @@ test_util_config_line_escaped_content(void) strlcpy(buf4, "BrokenOctal \"\\8\"\n" , sizeof(buf4)); + strlcpy(buf5, "BrokenHex \"\\xg4\"\n" + , sizeof(buf5)); + str = buf1; str = parse_config_line_from_str(str, &k, &v); @@ -405,6 +409,14 @@ test_util_config_line_escaped_content(void) test_eq_ptr(str, NULL); tor_free(k); tor_free(v); +#if 0 + str = buf5; + + str = parse_config_line_from_str(str, &k, &v); + test_eq_ptr(str, NULL); + tor_free(k); tor_free(v); +#endif + done: tor_free(k); tor_free(v); |