From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id IIteAIAXUWOOsA4AWB0awg (envelope-from ) for ; Thu, 20 Oct 2022 05:40:16 -0400 Received: by simark.ca (Postfix, from userid 112) id F38021E112; Thu, 20 Oct 2022 05:40:15 -0400 (EDT) Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=AGN0xV/h; dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_DYNAMIC,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (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 simark.ca (Postfix) with ESMTPS id C14621E0D5 for ; Thu, 20 Oct 2022 05:40:15 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 1149B383AF61 for ; Thu, 20 Oct 2022 09:39:31 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1149B383AF61 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1666258771; bh=yrpNTZ34RAg8DFUmRR7+QOweOqku/hmB7SOiApJX2MI=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=AGN0xV/hm+e2YKVQrFFAaExtFbBL+BMoB5etYCV1a4AYBxgSKHBeYZULc52r22Cym DLSE0GoW5xRKTv7eoczHPY4lv/WW0Qs+AKdRWCwJpzl7YhpkwqyGMy5w9McAdxvE3/ CRZF8ctszL6z0hSTZuqtCo/BBSbWSbcKkdVREBUU= Received: from mail-sender-0.a4lg.com (mail-sender-0.a4lg.com [IPv6:2401:2500:203:30b:4000:6bfe:4757:0]) by sourceware.org (Postfix) with ESMTPS id 26C8838B13DE for ; Thu, 20 Oct 2022 09:37:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 26C8838B13DE Received: from [127.0.0.1] (localhost [127.0.0.1]) by mail-sender-0.a4lg.com (Postfix) with ESMTPSA id 7B9EC300089; Thu, 20 Oct 2022 09:37:48 +0000 (UTC) To: Tsukasa OI , Andrew Burgess , Mike Frysinger , Nick Clifton Subject: [PATCH 28/40] sim/ppc: Initialize stat type buffer Date: Thu, 20 Oct 2022 09:32:33 +0000 Message-Id: In-Reply-To: References: Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Tsukasa OI via Gdb-patches Reply-To: Tsukasa OI Cc: gdb-patches@sourceware.org Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" On do_fstat function, stat typed buffer buf is passed to write_buf function uninitialized when fdbad(fd) is not zero. This commit initializes the buffer with the default value. --- sim/ppc/emul_netbsd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sim/ppc/emul_netbsd.c b/sim/ppc/emul_netbsd.c index 072a5df5598..34ad86ccbe9 100644 --- a/sim/ppc/emul_netbsd.c +++ b/sim/ppc/emul_netbsd.c @@ -881,7 +881,7 @@ do_fstat(os_emul_data *emul, { int fd = cpu_registers(processor)->gpr[arg0]; unsigned_word stat_buf_addr = cpu_registers(processor)->gpr[arg0+1]; - struct stat buf; + struct stat buf = {}; int status; #ifdef SYS_fstat SYS(fstat); -- 2.34.1