Module Name: src
Committed By: ozaki-r
Date: Wed Mar 2 07:48:20 UTC 2022
Modified Files:
src/usr.sbin/puffs/mount_9p: node.c
Log Message:
mount_9p: check returned type for Tread
To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/usr.sbin/puffs/mount_9p/node.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/usr.sbin/puffs/mount_9p/node.c
diff -u src/usr.sbin/puffs/mount_9p/node.c:1.30 src/usr.sbin/puffs/mount_9p/node.c:1.31
--- src/usr.sbin/puffs/mount_9p/node.c:1.30 Wed Mar 2 04:11:41 2022
+++ src/usr.sbin/puffs/mount_9p/node.c Wed Mar 2 07:48:20 2022
@@ -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 @@ puffs9p_node_readdir(struct puffs_usermo
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);
/*