summaryrefslogtreecommitdiff
path: root/sys/nfs
diff options
context:
space:
mode:
authorAaron Campbell <aaron@cvs.openbsd.org>2006-01-24 15:06:42 +0000
committerAaron Campbell <aaron@cvs.openbsd.org>2006-01-24 15:06:42 +0000
commit55ed7191539b1e13751499710c9b27d872808d52 (patch)
tree978750f4ef152706c75ed334cc6c375102afa41c /sys/nfs
parent87cecf79d0549c739cf544f20a223cc8b3b481e6 (diff)
Fix NULL dereference on error condition in nfs_reply(). nmp->nm_so can
become NULL if the nfs_reply() -> nfs_receive() -> nfs_reconnect() datapath fails. pedro@ ok "I think this is a good fix"
Diffstat (limited to 'sys/nfs')
-rw-r--r--sys/nfs/nfs_socket.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/nfs/nfs_socket.c b/sys/nfs/nfs_socket.c
index 5e2e1401ef1..77fa523d219 100644
--- a/sys/nfs/nfs_socket.c
+++ b/sys/nfs/nfs_socket.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nfs_socket.c,v 1.42 2005/04/02 01:00:38 mickey Exp $ */
+/* $OpenBSD: nfs_socket.c,v 1.43 2006/01/24 15:06:41 aaron Exp $ */
/* $NetBSD: nfs_socket.c,v 1.27 1996/04/15 20:20:00 thorpej Exp $ */
/*
@@ -699,7 +699,8 @@ nfs_reply(myrep)
* Ignore routing errors on connectionless protocols??
*/
if (NFSIGNORE_SOERROR(nmp->nm_soflags, error)) {
- nmp->nm_so->so_error = 0;
+ if (nmp->nm_so)
+ nmp->nm_so->so_error = 0;
if (myrep->r_flags & R_GETONEREP)
return (0);
continue;