Signed-off-by: Alex Henrie alexhenrie24@gmail.com --- These edge cases were identified by a program I wrote that feeds 10 million randomly generated IPv6-like strings to RtlIpv6StringToAddress and compares the output from my implementation to the output on Windows. I have now updated my implementation to pass all of the new tests and I intend to clean it up and send it to Wine Staging this weekend. --- dlls/ntdll/tests/rtl.c | 48 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+)
diff --git a/dlls/ntdll/tests/rtl.c b/dlls/ntdll/tests/rtl.c index c7470258fb..7b41c8b90e 100644 --- a/dlls/ntdll/tests/rtl.c +++ b/dlls/ntdll/tests/rtl.c @@ -1539,6 +1539,8 @@ static const struct { 0x1111, 0x2222, 0x3333, 0x4444, 0x5555, 0x6666, 0, 0x8888 } }, { "1111:2222:3333:4444:5555:6666::7777:8888", STATUS_SUCCESS, 35, { 0x1111, 0x2222, 0x3333, 0x4444, 0x5555, 0x6666, 0, 0x7777 }, ex_fail_6 }, + { "1111:2222:3333:4444:5555:6666:7777::8888", STATUS_SUCCESS, 36, + { 0x1111, 0x2222, 0x3333, 0x4444, 0x5555, 0x6666, 0x7777, 0 }, win_broken_6 }, { "1111:2222:3333:4444:5555::", STATUS_SUCCESS, 26, { 0x1111, 0x2222, 0x3333, 0x4444, 0x5555, 0, 0, 0 } }, { "1111:2222:3333:4444:5555::123.123.123.123", STATUS_SUCCESS, 41, @@ -1555,8 +1557,20 @@ static const struct { 0x1111, 0x2222, 0x3333, 0x4444, 0x5555, 0, 0, 0x8800 }, ex_fail_6 }, { "1111:2222:3333:4444:5555::0x8888", STATUS_SUCCESS, 27, { 0x1111, 0x2222, 0x3333, 0x4444, 0x5555, 0, 0, 0x8888 }, ex_fail_6 }, + { "1111:2222:3333:4444::5555:0x123456789", STATUS_SUCCESS, 27, + { 0x1111, 0x2222, 0x3333, 0x4444, 0, 0, 0x5555, 0xffff }, ex_fail_6 }, + { "1111:2222:3333:4444:5555:6666:0x012345678", STATUS_INVALID_PARAMETER, 31, + { 0x1111, 0x2222, 0x3333, 0x4444, 0x5555, 0x6666, 0xabab, 0xabab }, ex_fail_6 }, + { "1111:2222:3333:4444:5555:6666:0x123456789", STATUS_INVALID_PARAMETER, 31, + { 0x1111, 0x2222, 0x3333, 0x4444, 0x5555, 0x6666, 0xabab, 0xabab }, ex_fail_6 }, { "1111:2222:3333:4444:5555::08888", STATUS_INVALID_PARAMETER, 31, { 0x1111, 0x2222, 0x3333, 0x4444, 0x5555, 0xabab, 0xabab, 0xabab } }, + { "1111:2222:3333:4444:5555::08888::", STATUS_INVALID_PARAMETER, 31, + { 0x1111, 0x2222, 0x3333, 0x4444, 0x5555, 0xabab, 0xabab, 0xabab } }, + { "1111:2222:3333:4444:5555:6666:7777:fffff:", STATUS_INVALID_PARAMETER, 40, + { 0x1111, 0x2222, 0x3333, 0x4444, 0x5555, 0x6666, 0x7777, 0xabab } }, + { "1111:2222:3333:4444:5555:6666::fffff:", STATUS_INVALID_PARAMETER, 36, + { 0x1111, 0x2222, 0x3333, 0x4444, 0x5555, 0x6666, 0xabab, 0xabab } }, { "1111:2222:3333:4444:5555::fffff", STATUS_INVALID_PARAMETER, 31, { 0x1111, 0x2222, 0x3333, 0x4444, 0x5555, 0xabab, 0xabab, 0xabab } }, { "1111:2222:3333:4444::fffff", STATUS_INVALID_PARAMETER, 26, @@ -1672,16 +1686,24 @@ static const struct { -1 } }, { "1111", STATUS_INVALID_PARAMETER, 4, { -1 } }, + { "0x1111", STATUS_INVALID_PARAMETER, 1, + { -1 } }, { "1111:22223333:4444:5555:6666:1.2.3.4", STATUS_INVALID_PARAMETER, -1, { 0x1111, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab } }, { "1111:22223333:4444:5555:6666:7777:8888", STATUS_INVALID_PARAMETER, -1, { 0x1111, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab } }, + { "1111:123456789:4444:5555:6666:7777:8888", STATUS_INVALID_PARAMETER, -1, + { 0x1111, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab } }, + { "1111:1234567890abcdef0:4444:5555:6666:7777:888", STATUS_INVALID_PARAMETER, -1, + { 0x1111, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab } }, { "1111:2222:", STATUS_INVALID_PARAMETER, 10, { 0x1111, 0x2222, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab } }, { "1111:2222:1.2.3.4", STATUS_INVALID_PARAMETER, 17, { 0x1111, 0x2222, 0x201, 0xab03, 0xabab, 0xabab, 0xabab, 0xabab } }, { "1111:2222:3333", STATUS_INVALID_PARAMETER, 14, { 0x1111, 0x2222, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab } }, + { "1111:2222:3333:4444:5555:6666::1.2.3.4", STATUS_SUCCESS, 32, + { 0x1111, 0x2222, 0x3333, 0x4444, 0x5555, 0x6666, 0, 0x100 }, ex_fail_6 }, { "1111:2222:3333:4444:5555:6666:7777:1.2.3.4", STATUS_SUCCESS, 36, { 0x1111, 0x2222, 0x3333, 0x4444, 0x5555, 0x6666, 0x7777, 0x100 }, ex_fail_6 }, { "1111:2222:3333:4444:5555:6666:7777:8888:", STATUS_SUCCESS, 39, @@ -1702,10 +1724,26 @@ static const struct { 0x1111, 0, 0, 0, 0, 0, 0, 0x3333 }, ex_fail_6 }, { "12345::6:7:8", STATUS_INVALID_PARAMETER, -1, { -1 } }, + { "1::001.2.3.4", STATUS_SUCCESS, 12, + { 0x100, 0, 0, 0, 0, 0, 0x201, 0x403 } }, + { "1::1.002.3.4", STATUS_SUCCESS, 12, + { 0x100, 0, 0, 0, 0, 0, 0x201, 0x403 } }, + { "1::0001.2.3.4", STATUS_INVALID_PARAMETER, -1, + { 0x100, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab } }, + { "1::1.0002.3.4", STATUS_INVALID_PARAMETER, -1, + { 0x100, 0xab01, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab } }, { "1::1.2.256.4", STATUS_INVALID_PARAMETER, -1, { 0x100, 0x201, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab } }, + { "1::1.2.4294967296.4", STATUS_INVALID_PARAMETER, -1, + { 0x100, 0x201, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab } }, + { "1::1.2.18446744073709551616.4", STATUS_INVALID_PARAMETER, -1, + { 0x100, 0x201, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab } }, { "1::1.2.3.256", STATUS_INVALID_PARAMETER, 12, { 0x100, 0x201, 0xab03, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab } }, + { "1::1.2.3.4294967296", STATUS_INVALID_PARAMETER, 19, + { 0x100, 0x201, 0xab03, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab } }, + { "1::1.2.3.18446744073709551616", STATUS_INVALID_PARAMETER, 29, + { 0x100, 0x201, 0xab03, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab } }, { "1::1.2.3.300", STATUS_INVALID_PARAMETER, 12, { 0x100, 0x201, 0xab03, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab } }, { "1::1.2::1", STATUS_INVALID_PARAMETER, 6, @@ -1758,6 +1796,16 @@ static const struct { -1 } }, { "::-1", STATUS_SUCCESS, 2, { 0, 0, 0, 0, 0, 0, 0, 0 }, ex_fail_6 }, + { "::123456789", STATUS_INVALID_PARAMETER, 11, + { 0, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab } }, + { "::1234567890abcdef0", STATUS_INVALID_PARAMETER, 19, + { 0, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab } }, + { "::0x012345678", STATUS_SUCCESS, 3, + { 0, 0, 0, 0, 0, 0, 0, 0x7856 }, ex_fail_6 }, + { "::0x123456789", STATUS_SUCCESS, 3, + { 0, 0, 0, 0, 0, 0, 0, 0xffff }, ex_fail_6 }, + { "::0x1234567890abcdef0", STATUS_SUCCESS, 3, + { 0, 0, 0, 0, 0, 0, 0, 0xffff }, ex_fail_6 }, { "::.", STATUS_SUCCESS, 2, { 0, 0, 0, 0, 0, 0, 0, 0 }, ex_fail_6 }, { "::..", STATUS_SUCCESS, 2,
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=65598
Your paranoid android.
=== w1064v1809 (32 bit report) ===
ntdll: 1960:rtl: unhandled exception c0000005 at 77D89D4B
=== w1064v1809_2scr (32 bit report) ===
ntdll: 1a48:rtl: unhandled exception c0000005 at 77BA9D4B
=== w1064v1809_ar (32 bit report) ===
ntdll: 19e8:rtl: unhandled exception c0000005 at 77219D4B
=== w1064v1809_he (32 bit report) ===
ntdll: 1a08:rtl: unhandled exception c0000005 at 77D39D4B
=== w1064v1809_ja (32 bit report) ===
ntdll: 1aa4:rtl: unhandled exception c0000005 at 772B9D4B
=== w1064v1809_zh_CN (32 bit report) ===
ntdll: 19e8:rtl: unhandled exception c0000005 at 77979D4B
I just found a couple more test cases that should be included, so you can either commit this now and I'll send a follow-up patch with the new cases or you can wait and I'll send a v2.
-Alex