From patchwork Sat Nov 2 15:41:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heinrich Schuchardt X-Patchwork-Id: 2005522 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=sZqb+b+K; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Xghml4dp8z1xxy for ; Sun, 3 Nov 2024 02:41:59 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 3D4968898B; Sat, 2 Nov 2024 16:41:55 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=canonical.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.b="sZqb+b+K"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 036888899C; Sat, 2 Nov 2024 16:41:54 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from smtp-relay-canonical-0.canonical.com (smtp-relay-canonical-0.canonical.com [185.125.188.120]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id F377E8887A for ; Sat, 2 Nov 2024 16:41:51 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=canonical.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=heinrich.schuchardt@canonical.com Received: from LT2ubnt.. (dynamic-046-114-107-023.46.114.pool.telefonica.de [46.114.107.23]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-canonical-0.canonical.com (Postfix) with ESMTPSA id DA8923F1C5; Sat, 2 Nov 2024 15:41:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1730562108; bh=a8BmI8ogMF4gCs5QnTfQbWlcMqf3eWpNJzztgge3biQ=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=sZqb+b+KkiLKy1Ai62SjBWGt9KQf2fs3xbBPvE4ZYhjlFVOa5ntbKeFa3wDCVlv6N aAjDz/WADQsgmldcKZDpS7RfQI5p+dJRtOZEzMeGlTXpo+uS3at6+WoqkBmiTrQdqs QyEdSe0ZPbhi3kVkovyiljYDaizyJxbsYR9F/gTtogO3rkEmZUkWDY7ytC3G4EcED/ u4oGmOi3ng4Ybw6AuUCgVz+8RaRGZMHQbrpTUWS6l3zEOkGORMl6mnoCDTeRMvyo08 GXYb6BOVjVJIjZpUMLfS7EcXgAu5k9v9k5h68s9X3qROsmZ9/hTqryvZfGxHCrmSXx 8QafmngQMmo4A== From: Heinrich Schuchardt To: Simon Glass Cc: Alexander Gendin , Mattijs Korpershoek , u-boot@lists.denx.de, Heinrich Schuchardt Subject: [PATCH 1/1] test: cmd/mbr: pass correct buffer size to init_write_buffers Date: Sat, 2 Nov 2024 16:41:30 +0100 Message-ID: <20241102154130.267948-1-heinrich.schuchardt@canonical.com> X-Mailer: git-send-email 2.45.2 MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean We want to completely initialize the mbr and embr buffers. This requires passing the buffer size and not the size of a pointer to the buffer. Addresses-Coverity-ID: 510454 Wrong sizeof argument Signed-off-by: Heinrich Schuchardt --- test/cmd/mbr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/cmd/mbr.c b/test/cmd/mbr.c index b14137e589a..16a8bc39e7e 100644 --- a/test/cmd/mbr.c +++ b/test/cmd/mbr.c @@ -277,7 +277,7 @@ static int mbr_test_run(struct unit_test_state *uts) (ulong)0xbffe00 / BLKSZ)); /* Test one MBR partition */ - init_write_buffers(mbr_wbuf, sizeof(mbr_wbuf), ebr_wbuf, sizeof(ebr_wbuf), __LINE__); + init_write_buffers(mbr_wbuf, BLKSZ, ebr_wbuf, BLKSZ, __LINE__); ut_assertok(build_mbr_parts(mbr_parts_buf, sizeof(mbr_parts_buf), 1)); ut_assertok(run_commandf("write mmc 6:0 %lx 0 1", mbr_wa)); memset(rbuf, '\0', BLKSZ);