Skip to content

Commit

Permalink
9p: fix oops in protocol stat parsing error path.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Eric Van Hensbergen committed Oct 17, 2008
1 parent 57c7b4e commit f0a0ac2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions net/9p/protocol.c
Original file line number Diff line number Diff line change
Expand Up @@ -215,9 +215,9 @@ p9pdu_vreadf(struct p9_fcall *pdu, int optional, const char *fmt, va_list ap)
struct p9_wstat *stbuf =
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 =
-1;
-1;
errcode =
p9pdu_readf(pdu, optional,
"wwdQdddqssss?sddd",
Expand Down

0 comments on commit f0a0ac2

Please sign in to comment.