u413-284-si / webserv

This project is about setting up a http web server, providing a static website.
MIT License
0 stars 0 forks source link

49 ubsan reference binding to null pointer of type sockaddr #50

Closed gwolf-011235 closed 3 weeks ago

gwolf-011235 commented 3 weeks ago

SocketPolicy is a wrapper around socket related functions like getaddrinfo. The wrapper functions had references passed to struct addrinfo.

In tests MockSocketPolicy is used. In this tests dummy struct addrinfo are created. These structs also have a pointer to a struct sockaddr, which was init to NULL (since not used anyway). But this lead to passing a reference to NULL which was caught by UBSan as undefine behavior.

Changes: