From: Takashi Iwai Subject: Re: [PATCH 6/8] coverity fix in alsa-libs Date: Thu, 18 Sep 2014 17:28:07 +0200 Message-ID: References: <7B.6B.05030.F22CA145@epcpsbgx4.samsung.com> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx2.suse.de (cantor2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id 9AC85265560 for ; Thu, 18 Sep 2014 17:28:07 +0200 (CEST) In-Reply-To: <7B.6B.05030.F22CA145@epcpsbgx4.samsung.com> <20574820.99381411039791108.JavaMail.weblogic@epv6ml12> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org To: renu.tyagi@samsung.com Cc: alsa-devel@alsa-project.org List-Id: alsa-devel@alsa-project.org At Thu, 18 Sep 2014 11:29:51 +0000 (GMT), Renu Tyagi wrote: > > Hi, > Bug Type : If lib is NULL return error to avoid strlen of NULL string > File changed : simple_abst.c > PFA patch6 > > Thanks > Renu Tyagi > ---------------------------------------------------------------------------------------- > From 052755ef6fec398f4e49bd31e9e60fe42a14ba53 Mon Sep 17 00:00:00 2001 > From: renu tyagi > Date: Thu, 18 Sep 2014 16:41:43 +0530 > Subject: [PATCH 6/8] [simple_abst] : If lib is NULL return error to avoid strlen of NULL string. > > > Signed-off-by: renu tyagi > --- > src/mixer/simple_abst.c | 2 ++ > 1 files changed, 2 insertions(+), 0 deletions(-) > > diff --git a/src/mixer/simple_abst.c b/src/mixer/simple_abst.c > index 9e9aaf5..67330c2 100644 > --- a/src/mixer/simple_abst.c > +++ b/src/mixer/simple_abst.c > @@ -71,6 +71,8 @@ static int try_open(snd_mixer_class_t *class, const char *lib) > int err = 0; > > path = getenv("ALSA_MIXER_SIMPLE_MODULES"); > + if (!lib) > + return -ENXIO; This should be put before getenv() call. Please fix and resubmit? Takashi > if (!path) > path = SO_PATH; > xlib = malloc(strlen(lib) + strlen(path) + 1 + 1); > -- > 1.7.1