svn commit: r198542 - head/lib/libstand

Christian Brueffer brueffer at FreeBSD.org
Wed Oct 28 14:13:46 UTC 2009


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);
     }
 


More information about the svn-src-all mailing list