From: "Jan Beulich" Subject: Re: [PATCH v2 3/3] tmem: fix Out-of-bounds read reported by Coverity Date: Wed, 07 May 2014 09:33:40 +0100 Message-ID: <536A0C04020000780000FBE1@mail.emea.novell.com> References: <1399444250-17529-1-git-send-email-bob.liu@oracle.com> <1399444250-17529-3-git-send-email-bob.liu@oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WhxIO-0001Qg-SL for xen-devel@lists.xenproject.org; Wed, 07 May 2014 08:33:45 +0000 In-Reply-To: <1399444250-17529-3-git-send-email-bob.liu@oracle.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Bob Liu Cc: andrew.cooper3@citrix.com, keir@xen.org, xen-devel@lists.xenproject.org List-Id: xen-devel@lists.xenproject.org >>> 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. Jan