Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 28 Oct 2009 14:13:46 +0000 (UTC)
From:      Christian Brueffer <brueffer@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r198542 - head/lib/libstand
Message-ID:  <200910281413.n9SEDkjd063459@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: brueffer
Date: Wed Oct 28 14:13:45 2009
New Revision: 198542
URL: http://svn.freebsd.org/changeset/base/198542

Log:
  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

Modified:
  head/lib/libstand/open.c

Modified: head/lib/libstand/open.c
==============================================================================
--- head/lib/libstand/open.c	Wed Oct 28 13:50:28 2009	(r198541)
+++ head/lib/libstand/open.c	Wed Oct 28 14:13:45 2009	(r198542)
@@ -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);
     }
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200910281413.n9SEDkjd063459>