Commit d7776f65 authored by vvb2060's avatar vvb2060 Committed by John Wu

Return empty on failure to get context

parent 3219d945
...@@ -27,7 +27,7 @@ bool get_client_cred(int fd, sock_cred *cred) { ...@@ -27,7 +27,7 @@ bool get_client_cred(int fd, sock_cred *cred) {
char buf[4096]; char buf[4096];
len = sizeof(buf); len = sizeof(buf);
if (getsockopt(fd, SOL_SOCKET, SO_PEERSEC, buf, &len) != 0) if (getsockopt(fd, SOL_SOCKET, SO_PEERSEC, buf, &len) != 0)
return false; len = 0;
buf[len] = '\0'; buf[len] = '\0';
cred->context = buf; cred->context = buf;
return true; return true;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment