Browse Source

9p: fix oops in protocol stat parsing error path.

When we get an error on parsing a stat due to a protocol bug, 
we can generate an oops during cleanup because we didn't 
initialize the string pointers in the stat structure.

Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
Eric Van Hensbergen 16 years ago
parent
commit
f0a0ac2ee5
1 changed files with 2 additions and 2 deletions
  1. 2 2
      net/9p/protocol.c

+ 2 - 2
net/9p/protocol.c

@@ -215,9 +215,9 @@ p9pdu_vreadf(struct p9_fcall *pdu, int optional, const char *fmt, va_list ap)
 				struct p9_wstat *stbuf =
 				struct p9_wstat *stbuf =
 				    va_arg(ap, struct p9_wstat *);
 				    va_arg(ap, struct p9_wstat *);
 
 
-				stbuf->extension = NULL;
+				memset(stbuf, 0, sizeof(struct p9_wstat));
 				stbuf->n_uid = stbuf->n_gid = stbuf->n_muid =
 				stbuf->n_uid = stbuf->n_gid = stbuf->n_muid =
-				    -1;
+									-1;
 				errcode =
 				errcode =
 				    p9pdu_readf(pdu, optional,
 				    p9pdu_readf(pdu, optional,
 						"wwdQdddqssss?sddd",
 						"wwdQdddqssss?sddd",