From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bob Liu Subject: Re: [PATCH v2 3/3] tmem: fix Out-of-bounds read reported by Coverity Date: Thu, 08 May 2014 16:47:42 +0800 Message-ID: <536B44AE.40401@oracle.com> References: <1399444250-17529-1-git-send-email-bob.liu@oracle.com> <1399444250-17529-3-git-send-email-bob.liu@oracle.com> <536A0C04020000780000FBE1@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WiJzh-00007Z-2W for xen-devel@lists.xenproject.org; Thu, 08 May 2014 08:47:57 +0000 In-Reply-To: <536A0C04020000780000FBE1@mail.emea.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich Cc: Bob Liu , keir@xen.org, ian.campbell@citrix.com, andrew.cooper3@citrix.com, stefano.stabellini@eu.citrix.com, ian.jackson@eu.citrix.com, xen-devel@lists.xenproject.org List-Id: xen-devel@lists.xenproject.org On 05/07/2014 04:33 PM, Jan Beulich wrote: >>>> On 07.05.14 at 08:30, wrote: >> CID 1198729, CID 1198730 and CID 1198734 complain about >> "Out-of-bounds read". >> >> This patch fixes them by casting the 'firstbyte' to (uint8_t), some >> unnecessary assertion also be dropped. >> >> Signed-off-by: Bob Liu >> Reviewed-by: Andrew Cooper > > It looks to me as if the code was more correct without these changes, > and doing these changes just to work around a pretty obvious > Coverity flaw seems rather odd. > Okay, then please consider merge 1/3 and 2/3. -- Regards, -Bob