mirror of
https://review.haiku-os.org/haiku
synced 2025-02-22 21:48:35 +01:00
Check the given path for ".."
This commit is contained in:
parent
5ae9ef055c
commit
f05b8e3873
@ -118,10 +118,13 @@ ethernet_link_checker(void *)
|
||||
status_t
|
||||
ethernet_init(const char *name, net_device **_device)
|
||||
{
|
||||
// make sure this is a device in /dev/net, but not the
|
||||
// networking (userland) stack driver
|
||||
// Make sure this is a device in /dev/net, but not the
|
||||
// networking (userland) stack driver.
|
||||
// Also make sure the user didn't pass a path like
|
||||
// /dev/net/../etc.
|
||||
if (strncmp(name, "/dev/net/", 9)
|
||||
|| !strcmp(name, "/dev/net/userland_server"))
|
||||
|| !strcmp(name, "/dev/net/userland_server")
|
||||
|| strstr(name, "..") != NULL)
|
||||
return B_BAD_VALUE;
|
||||
|
||||
if (access(name, F_OK) != 0)
|
||||
|
Loading…
x
Reference in New Issue
Block a user