diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2020-06-27 00:37:01 +0200 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2020-06-27 00:37:01 +0200 |
commit | b95271e96190f0b854b46c8d5b8aab1a812d35a8 (patch) | |
tree | b4f17aebdb6ccd71c5bd331a390f2ccb2f0a4e77 /pflocal | |
parent | 7f8a212698d49413af6f2682585a6bd7a3279fc4 (diff) | |
download | hurd-b95271e96190f0b854b46c8d5b8aab1a812d35a8.tar.gz hurd-b95271e96190f0b854b46c8d5b8aab1a812d35a8.tar.bz2 hurd-b95271e96190f0b854b46c8d5b8aab1a812d35a8.zip |
pflocal: Fix crash on passing erroneous port
* pflocal/socket.c (S_socket_getopt): Read `user->sock' after checking
`user'.
Diffstat (limited to 'pflocal')
-rw-r--r-- | pflocal/socket.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/pflocal/socket.c b/pflocal/socket.c index d0751c9f..7a856bec 100644 --- a/pflocal/socket.c +++ b/pflocal/socket.c @@ -435,11 +435,13 @@ S_socket_getopt (struct sock_user *user, { int ret = 0; struct pipe *pipe; - struct sock *sock = user->sock; + struct sock *sock; if (!user) return EOPNOTSUPP; + sock = user->sock; + pthread_mutex_lock (&sock->lock); switch (level) { |