From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4A15926AC3 for ; Fri, 13 Feb 2026 10:33:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770978820; cv=none; b=r/U36oLOvTjkkBQi6E/jqvIFf59KnRIWlurUBIQI+PGxFWUm65204cSaCSlfkyo7t8eikiyvbK2CBB9QceIFBcVnHlaysZhRqZd4lHHN0QBLaqRc9T+UeYq7XVcB7qmRQTCrVLvr+F6vaALB08SS0xsCEdxLVjLCFAKUm276JIM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770978820; c=relaxed/simple; bh=mdzFMU731FW5Xgieyv+HsMg5yWc/FhGhE32cBPrudZY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=DtIeiTp4AbAjotP04ItQPouw3x41yzAHy9zhBRhs9Fc/d1MXHqZGZBf/GJKLLmj4U+5yrw+3lNhDeoSNmCmhGoiyGkTE+1+btHhQ2uwHOQq2uJxddTH1AS71m80k1nTEx0braH/OS3YSe9qshK85C1VDz1G5HjNwQVdB5FZDxdE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=YJCdXexW; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="YJCdXexW" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 32A5FC116C6; Fri, 13 Feb 2026 10:33:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1770978819; bh=mdzFMU731FW5Xgieyv+HsMg5yWc/FhGhE32cBPrudZY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=YJCdXexWg1eFm7Mj14c8/tBsuEdKMF8fh/jUTd/5zW62TKeJjbxXDUdVSRBYScUsH VPwIjDDaCsdkOMYo+XrNz4fQ6uzZN+VhUh5h1KrEwjNaaHdHHcaax1TLb76Yc+FqwU JoSHuUXLZsvXZgjuw1DjPsGhDNA933S7POMvsGucxDnttPshfiNEhNzzyNbrJGkugY IdV7fGYYwX8DePMniRrhibWl6LG2ccBKm6JMche/LutVBLoZ3xfdbtsiWsf6xhra0U cQwuQzwMC9drLmHRhkGCNOhoPQIob0Hd/7lEPB9Lc/+RMyqlti2VxkE1X0Nc1TjfWB horQ+XA8H4RjA== Date: Fri, 13 Feb 2026 11:33:35 +0100 From: Alexey Gladkov To: Krdyan Areg Cc: kbd@lists.linux.dev Subject: Re: [PATCH] setfont: explicitly initialize ptr to NULL Message-ID: References: <20260212141339.1187595-1-areg.krdian@gmail.com> Precedence: bulk X-Mailing-List: kbd@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260212141339.1187595-1-areg.krdian@gmail.com> On Thu, Feb 12, 2026 at 05:13:39PM +0300, Krdyan Areg wrote: > Variable 'ptr' is declared but not initialized. If an error occurs before > the first loop iteration, the error path at 'end' label calls free(ptr) > on an uninitialized pointer. > > Signed-off-by: Krdyan Areg Applied. Thanks! > --- > src/libkfont/setfont.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/src/libkfont/setfont.c b/src/libkfont/setfont.c > index 45652c0..06dc425 100644 > --- a/src/libkfont/setfont.c > +++ b/src/libkfont/setfont.c > @@ -281,7 +281,7 @@ kfont_load_fonts(struct kfont_context *ctx, > unsigned char *inbuf, *fontbuf, *bigfontbuf; > unsigned int inputlth, fontbuflth, fontsize, height, width; > unsigned int bigfontbuflth, bigfontsize, bigheight, bigwidth; > - unsigned char *ptr; > + unsigned char *ptr = NULL; > struct unicode_list *uclistheads; > struct kbdfile *fp = NULL; > int i; > -- > 2.52.0 > > -- Rgrds, legion