From 357dbf911560268d5567e4bbbd4e25bf3cdd05a1 Mon Sep 17 00:00:00 2001 From: guenther Date: Mon, 19 Jan 2015 21:18:47 +0000 Subject: The kernel doesn't actually care what a sockaddr's sa_len is on input, so don't waste code setting it improvment and ok florian@ --- slowcgi.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/slowcgi.c b/slowcgi.c index 44595bb..069b1e9 100644 --- a/slowcgi.c +++ b/slowcgi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: slowcgi.c,v 1.42 2015/01/16 06:40:20 deraadt Exp $ */ +/* $OpenBSD: slowcgi.c,v 1.43 2015/01/19 21:18:47 guenther Exp $ */ /* * Copyright (c) 2013 David Gwynne * Copyright (c) 2013 Florian Obser @@ -355,7 +355,6 @@ slowcgi_listen(char *path, struct passwd *pw) { struct listener *l = NULL; struct sockaddr_un sun; - size_t len; mode_t old_umask; int fd; @@ -365,10 +364,9 @@ slowcgi_listen(char *path, struct passwd *pw) bzero(&sun, sizeof(sun)); sun.sun_family = AF_UNIX; - len = strlcpy(sun.sun_path, path, sizeof(sun.sun_path)); - if (len >= sizeof(sun.sun_path)) + if (strlcpy(sun.sun_path, path, sizeof(sun.sun_path)) >= + sizeof(sun.sun_path)) lerrx(1, "socket path to long"); - sun.sun_len = len; if (unlink(path) == -1) if (errno != ENOENT) -- cgit v1.2.3-2-gb3c3