summaryrefslogtreecommitdiffstats
path: root/lib/libstand
diff options
context:
space:
mode:
authorbrueffer <brueffer@FreeBSD.org>2009-10-28 14:13:45 +0000
committerbrueffer <brueffer@FreeBSD.org>2009-10-28 14:13:45 +0000
commit533638121604719e3b00d6567345fa53881b78d0 (patch)
treeda46fb1c504968a12c7f1ebab919129a558cf991 /lib/libstand
parent7cbed3562924694ebb3cf3a719ddc98a8edb8f0a (diff)
downloadFreeBSD-src-533638121604719e3b00d6567345fa53881b78d0.zip
FreeBSD-src-533638121604719e3b00d6567345fa53881b78d0.tar.gz
Initialize f_rabuf in the raw device case. A subsequent close()
later on would try to free it, leading to a crash. PR: 93998 Submitted by: neel MFC after: 1 week
Diffstat (limited to 'lib/libstand')
-rw-r--r--lib/libstand/open.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/libstand/open.c b/lib/libstand/open.c
index acbda1c..49dc660 100644
--- a/lib/libstand/open.c
+++ b/lib/libstand/open.c
@@ -113,6 +113,7 @@ open(const char *fname, int mode)
/* see if we opened a raw device; otherwise, 'file' is the file name. */
if (file == (char *)0 || *file == '\0') {
f->f_flags |= F_RAW;
+ f->f_rabuf = NULL;
return (fd);
}
OpenPOWER on IntegriCloud