Module Name: src Committed By: martin Date: Wed Jan 6 20:16:57 UTC 2010
Modified Files: src/sys/dev/scsipi: cd.c Log Message: Some usb devices come with an internal emulated umass CD drive (containing windows drivers). I have such a device that has 0 features - avoid wrappig features_len to a very big unsiged 32bit number in this case. To generate a diff of this commit: cvs rdiff -u -r1.296 -r1.297 src/sys/dev/scsipi/cd.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/dev/scsipi/cd.c diff -u src/sys/dev/scsipi/cd.c:1.296 src/sys/dev/scsipi/cd.c:1.297 --- src/sys/dev/scsipi/cd.c:1.296 Sun Dec 6 22:48:17 2009 +++ src/sys/dev/scsipi/cd.c Wed Jan 6 20:16:57 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: cd.c,v 1.296 2009/12/06 22:48:17 dyoung Exp $ */ +/* $NetBSD: cd.c,v 1.297 2010/01/06 20:16:57 martin Exp $ */ /*- * Copyright (c) 1998, 2001, 2003, 2004, 2005, 2008 The NetBSD Foundation, @@ -50,7 +50,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: cd.c,v 1.296 2009/12/06 22:48:17 dyoung Exp $"); +__KERNEL_RCSID(0, "$NetBSD: cd.c,v 1.297 2010/01/06 20:16:57 martin Exp $"); #include "rnd.h" @@ -3005,6 +3005,8 @@ } features_len = _4btol(gc->data_len); + if (features_len < 4) + break; pos = 0; fpos = &gc->feature_desc[0];