From: Tom Rini Date: Tue, 26 Sep 2017 22:45:49 -0400 Subject: [U-Boot] [U-Boot, 1/1] GPT: incomplete initialization in allocate_disk_part In-Reply-To: <20170921170306.12255-1-xypron.glpk@gmx.de> References: <20170921170306.12255-1-xypron.glpk@gmx.de> Message-ID: <20170927024549.GR3112@bill-the-cat> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Thu, Sep 21, 2017 at 07:03:06PM +0200, Heinrich Schuchardt wrote: > memset(newpart, '\0', sizeof(newpart)); > only initializes the firest 4 or 8 bytes of *newpart and not the whole > structure disk_part. > > We should use sizeof(struct disk_part). > > Instead of malloc and memset we can use calloc. > > Identified by cppcheck. > > Fixes: 09a49930e41 GPT: read partition table from device into a data structure > Reported-by: Coverity (CID: 167228) > Cc: Stefan Roese > Signed-off-by: Heinrich Schuchardt > Reviewed-by: Stefan Roese > Reviewed-by: Simon Glass Applied to u-boot/master, thanks! -- Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: