svn commit: r198890 - stable/6/lib/libstand

Christian Brueffer brueffer at FreeBSD.org
Wed Nov 4 13:41:43 UTC 2009


Author: brueffer
Date: Wed Nov  4 13:41:43 2009
New Revision: 198890
URL: http://svn.freebsd.org/changeset/base/198890

Log:
  MFC: 198542
  
  Initialize f_rabuf in the raw device case. A subsequent close()
  later on would try to free it, leading to a crash.

Modified:
  stable/6/lib/libstand/open.c
Directory Properties:
  stable/6/lib/libstand/   (props changed)

Modified: stable/6/lib/libstand/open.c
==============================================================================
--- stable/6/lib/libstand/open.c	Wed Nov  4 13:40:50 2009	(r198889)
+++ stable/6/lib/libstand/open.c	Wed Nov  4 13:41:43 2009	(r198890)
@@ -117,6 +117,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