From 8d2d10aa055536ac0200eb55f3e8714529dfd99d Mon Sep 17 00:00:00 2001 From: christos Date: Thu, 25 May 2006 00:27:56 +0000 Subject: [PATCH] Coverity CID 2524: Return error instead of trying to allocate random bytes from the stack. --- common/loop-bsd.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/common/loop-bsd.c b/common/loop-bsd.c index 0175796..6443e93 100644 --- a/common/loop-bsd.c +++ b/common/loop-bsd.c @@ -1,4 +1,4 @@ -/* $NetBSD: loop-bsd.c,v 1.7 2003/04/20 00:17:22 christos Exp $ */ +/* $NetBSD: loop-bsd.c,v 1.8 2006/05/25 00:27:56 christos Exp $ */ /* * Copyright (c) 1993-95 Mats O Jansson. All rights reserved. @@ -31,7 +31,7 @@ #include #ifndef lint -__RCSID("$NetBSD: loop-bsd.c,v 1.7 2003/04/20 00:17:22 christos Exp $"); +__RCSID("$NetBSD: loop-bsd.c,v 1.8 2006/05/25 00:27:56 christos Exp $"); #endif #include @@ -118,7 +118,8 @@ Loop() if (iflist->fd != -1) { if (ioctl(iflist->fd, BIOCGBLEN, (caddr_t) & bufsize) < 0) mopLogErr("BIOCGBLEN"); - } + } else + mopLogErrX("cannot get buffer size"); buf = (u_char *) malloc((unsigned) bufsize); if (buf == 0) mopLogErr("malloc");