mirror of
https://github.com/libuv/libuv
synced 2025-03-28 21:13:16 +00:00
fix: reject zero-length idna inputs
This commit is contained in:
parent
fd08591bf9
commit
927b2c6719
@ -322,6 +322,9 @@ ssize_t uv__idna_toascii(const char* s, const char* se, char* d, char* de) {
|
||||
char* ds;
|
||||
int rc;
|
||||
|
||||
if (s == se)
|
||||
return UV_EINVAL;
|
||||
|
||||
ds = d;
|
||||
|
||||
si = s;
|
||||
|
@ -115,6 +115,7 @@ TEST_IMPL(utf8_decode1_overrun) {
|
||||
ASSERT_PTR_EQ(p, b + 1);
|
||||
|
||||
b[0] = 0x7F;
|
||||
ASSERT_EQ(UV_EINVAL, uv__idna_toascii(b, b + 0, c, c + 1));
|
||||
ASSERT_EQ(UV_EINVAL, uv__idna_toascii(b, b + 1, c, c + 1));
|
||||
|
||||
return 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user