mirror of
https://github.com/transmission/transmission
synced 2025-02-20 21:26:53 +00:00
(trunk, libT) #5150 'improper escaping of dirnames with new json' -- added new regression test, currently failing, to trigger this bug
This commit is contained in:
parent
06fb61cbda
commit
dffc6343ae
1 changed files with 18 additions and 1 deletions
|
@ -193,6 +193,22 @@ test3( void )
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
test_unescape (void)
|
||||
{
|
||||
const char * in = "{ \"string-1\": \"\\/usr\\/lib\" }";
|
||||
tr_benc top;
|
||||
const char * str;
|
||||
|
||||
const int err = tr_jsonParse (NULL, in, strlen(in), &top, NULL);
|
||||
check_int_eq (0, err);
|
||||
check (tr_bencDictFindStr (&top, "string-1", &str));
|
||||
check_streq ("/usr/lib", str);
|
||||
|
||||
tr_bencFree (&top);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
main( void )
|
||||
{
|
||||
|
@ -200,7 +216,8 @@ main( void )
|
|||
test_utf8,
|
||||
test1,
|
||||
test2,
|
||||
test3, };
|
||||
test3,
|
||||
test_unescape };
|
||||
|
||||
return runTests(tests, NUM_TESTS(tests));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue