Coverity CID 1543: Fix buffer off-by-one on error.
This commit is contained in:
parent
14ac201ca2
commit
cb23cf75a0
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: isapnpres.c,v 1.15 2005/12/11 12:22:16 christos Exp $ */
|
||||
/* $NetBSD: isapnpres.c,v 1.16 2006/04/13 03:34:46 christos Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1996 The NetBSD Foundation, Inc.
|
||||
|
@ -41,7 +41,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: isapnpres.c,v 1.15 2005/12/11 12:22:16 christos Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: isapnpres.c,v 1.16 2006/04/13 03:34:46 christos Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
|
@ -519,7 +519,7 @@ parse:
|
|||
if (len >= ISAPNP_MAX_TAGSIZE) {
|
||||
printf("%s: Maximum tag size exceeded, card %d\n",
|
||||
sc->sc_dev.dv_xname, c + 1);
|
||||
len = ISAPNP_MAX_TAGSIZE;
|
||||
len = ISAPNP_MAX_TAGSIZE - 1;
|
||||
if (++warned == 10)
|
||||
goto bad;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue