mirror of
https://github.com/denoland/deno.git
synced 2024-11-21 15:04:11 -05:00
fix(ext/net): should not panic when listening to unix abstract address (#12300)
This commit is contained in:
parent
21520f5ff1
commit
198f5b9514
2 changed files with 16 additions and 5 deletions
|
@ -625,3 +625,18 @@ unitTest(
|
|||
listener.close();
|
||||
},
|
||||
);
|
||||
|
||||
unitTest(
|
||||
{
|
||||
ignore: Deno.build.os !== "linux",
|
||||
permissions: { read: true, write: true },
|
||||
},
|
||||
function netUnixAbstractPathShouldNotPanic() {
|
||||
const listener = Deno.listen({
|
||||
path: "\0aaa",
|
||||
transport: "unix",
|
||||
});
|
||||
assert("not panic");
|
||||
listener.close();
|
||||
},
|
||||
);
|
||||
|
|
|
@ -518,11 +518,7 @@ where
|
|||
} else {
|
||||
net_unix::listen_unix_packet(state, address_path)?
|
||||
};
|
||||
debug!(
|
||||
"New listener {} {}",
|
||||
rid,
|
||||
local_addr.as_pathname().unwrap().display(),
|
||||
);
|
||||
debug!("New listener {} {:?}", rid, local_addr);
|
||||
let unix_addr = net_unix::UnixAddr {
|
||||
path: local_addr.as_pathname().and_then(net_unix::pathstring),
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue