summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorratchov <ratchov@openbsd.org>2012-12-06 08:13:04 +0000
committerratchov <ratchov@openbsd.org>2012-12-06 08:13:04 +0000
commit6bd694d1cb0624ee190c30e2c60aa8fdefd7275e (patch)
treeb04fa036309f29bcf8dacbe979b58cd5d914acf4
parentFix some problems with the keys-command test: (diff)
downloadwireguard-openbsd-6bd694d1cb0624ee190c30e2c60aa8fdefd7275e.tar.xz
wireguard-openbsd-6bd694d1cb0624ee190c30e2c60aa8fdefd7275e.zip
set port = NULL for new connctions, fixes crashes
found by brad
-rw-r--r--usr.bin/sndiod/sock.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/sndiod/sock.c b/usr.bin/sndiod/sock.c
index 9e614f3515a..b909e08cea3 100644
--- a/usr.bin/sndiod/sock.c
+++ b/usr.bin/sndiod/sock.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sock.c,v 1.4 2012/12/01 12:13:34 ratchov Exp $ */
+/* $OpenBSD: sock.c,v 1.5 2012/12/06 08:13:04 ratchov Exp $ */
/*
* Copyright (c) 2008-2012 Alexandre Ratchov <alex@caoua.org>
*
@@ -853,8 +853,8 @@ sock_hello(struct sock *f)
return 0;
}
f->pstate = SOCK_INIT;
+ f->port = NULL;
if (mode & MODE_MIDIMASK) {
- f->port = NULL;
f->slot = NULL;
f->midi = midi_new(&sock_midiops, f, mode);
if (f->midi == NULL)