From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from aserp2120.oracle.com ([141.146.126.78]:60334 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933208AbeEYNWc (ORCPT ); Fri, 25 May 2018 09:22:32 -0400 Date: Fri, 25 May 2018 16:21:57 +0300 From: Dan Carpenter To: Hans Verkuil Cc: "Lad, Prabhakar" , Manjunath Hadli , Mauro Carvalho Chehab , linux-media@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: Re: [PATCH v2] media: davinci vpbe: array underflow in vpbe_enum_outputs() Message-ID: <20180525132157.rx3fuvzytpsuysft@mwanda> References: <20180525131239.45exrwgxr2f3kb57@kili.mountain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-media-owner@vger.kernel.org List-ID: On Fri, May 25, 2018 at 03:16:21PM +0200, Hans Verkuil wrote: > On 25/05/18 15:12, Dan Carpenter wrote: > > In vpbe_enum_outputs() we check if (temp_index >= cfg->num_outputs) but > > the problem is that temp_index can be negative. I've made > > cgf->num_outputs unsigned to fix this issue. > > Shouldn't temp_index also be made unsigned? It certainly would make a lot of > sense to do that. Yeah, sure. It doesn't make any difference in terms of runtime but it's probably cleaner. regards, dan carpenter