Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.sbin/puffs/mount_9p mount_9p: check returned type for Tread



details:   https://anonhg.NetBSD.org/src/rev/53dc667a58e8
branches:  trunk
changeset: 362481:53dc667a58e8
user:      ozaki-r <ozaki-r%NetBSD.org@localhost>
date:      Wed Mar 02 07:48:20 2022 +0000

description:
mount_9p: check returned type for Tread

diffstat:

 usr.sbin/puffs/mount_9p/node.c |  9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diffs (30 lines):

diff -r 89f70d3df0b8 -r 53dc667a58e8 usr.sbin/puffs/mount_9p/node.c
--- a/usr.sbin/puffs/mount_9p/node.c    Wed Mar 02 04:11:41 2022 +0000
+++ b/usr.sbin/puffs/mount_9p/node.c    Wed Mar 02 07:48:20 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: node.c,v 1.30 2022/03/02 04:11:41 ozaki-r Exp $        */
+/*     $NetBSD: node.c,v 1.31 2022/03/02 07:48:20 ozaki-r Exp $        */
 
 /*
  * Copyright (c) 2007  Antti Kantee.  All Rights Reserved.
@@ -27,7 +27,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: node.c,v 1.30 2022/03/02 04:11:41 ozaki-r Exp $");
+__RCSID("$NetBSD: node.c,v 1.31 2022/03/02 07:48:20 ozaki-r Exp $");
 #endif /* !lint */
 
 #include <assert.h>
@@ -187,6 +187,11 @@
        p9pbuf_put_4(pb, *reslen); /* XXX */
        GETRESPONSE(pb);
 
+       if (p9pbuf_get_type(pb) != P9PROTO_R_READ) {
+               rv = proto_handle_rerror(pu, pb);
+               goto out;
+       }
+
        p9pbuf_get_4(pb, &count);
 
        /*



Home | Main Index | Thread Index | Old Index