mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-23 09:46:04 -05:00
Tests: Assert the path fits
This commit is contained in:
parent
1cdd798ac7
commit
0106647ab8
Notes:
sideshowbarker
2024-07-19 02:59:18 +09:00
Author: https://github.com/bugaevc Commit: https://github.com/SerenityOS/serenity/commit/0106647ab8b Pull-request: https://github.com/SerenityOS/serenity/pull/3296 Reviewed-by: https://github.com/BenWiederhake Reviewed-by: https://github.com/alimpfard
1 changed files with 2 additions and 1 deletions
|
@ -24,6 +24,7 @@
|
|||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <AK/Assertions.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <sys/socket.h>
|
||||
|
@ -47,7 +48,7 @@ int main(int, char**)
|
|||
struct sockaddr_un addr;
|
||||
memset(&addr, 0, sizeof(addr));
|
||||
addr.sun_family = AF_UNIX;
|
||||
strlcpy(addr.sun_path, path, sizeof(addr.sun_path));
|
||||
ASSERT(strlcpy(addr.sun_path, path, sizeof(addr.sun_path)) < sizeof(addr.sun_path));
|
||||
|
||||
rc = bind(fd, (struct sockaddr*)(&addr), sizeof(addr));
|
||||
if (rc < 0 && errno == EADDRINUSE) {
|
||||
|
|
Loading…
Add table
Reference in a new issue