mirror of
https://github.com/stefanberger/swtpm.git
synced 2026-02-05 05:59:18 +00:00
swtpm: fix segfault introduced in aa3999
Changeset aa3999 introduced a segfault when calling ctrlchannel_set_client_fd() with a NULL pointer. Like all the other functions, we return with -1 in this case. Since the segfault occurred on process shutdown no problems were noticeable through bad test results or so. Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
This commit is contained in:
parent
061f9dce5e
commit
ca7f7a4006
@ -114,8 +114,12 @@ int ctrlchannel_get_client_fd(struct ctrlchannel *cc)
|
||||
|
||||
int ctrlchannel_set_client_fd(struct ctrlchannel *cc, int fd)
|
||||
{
|
||||
int clientfd = cc->clientfd;
|
||||
int clientfd;
|
||||
|
||||
if (!cc)
|
||||
return -1;
|
||||
|
||||
clientfd = cc->clientfd;
|
||||
cc->clientfd = fd;
|
||||
|
||||
return clientfd;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user