From 9eaecb924f06c8aaa84e6c55580b00d3ee708442 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Mon, 17 Sep 2018 18:21:53 +0000 Subject: bugfix: if HASGETPEERUCRED, getpeereid() had UB --- src/libposixplz/getpeereid.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libposixplz/getpeereid.c b/src/libposixplz/getpeereid.c index ae1142f..033a0af 100644 --- a/src/libposixplz/getpeereid.c +++ b/src/libposixplz/getpeereid.c @@ -38,7 +38,7 @@ int getpeereid (int s, uid_t *u, gid_t *g) int getpeereid (int s, uid_t *u, gid_t *g) { - ucred_t *cred ; + ucred_t *cred = 0 ; if (getpeerucred(s, &cred) == -1) return -1 ; *u = ucred_geteuid(cred) ; *g = ucred_getegid(cred) ; -- cgit v1.2.3