From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2103) id 334933858D20; Mon, 11 Mar 2024 17:18:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 334933858D20 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1710177480; bh=XcCmnGV2dw27kyf3/lUtKAQqt+XIBPgdbiJ53Jczm7U=; h=From:To:Subject:Date:From; b=jaVXiZvft7f2beJD0Yl/eEjoYGJiAOSDdYq6hpozdHCZ+XXLppA74jifOjyl+qHYj W0RSxlSxNo8rCF2lkI2obmNQeSFiIyduB1+/RA5INjnQx7zRO8grV/DHXCznRAswWV fzPR5b220mzq3dVJuw+JTgyzYJOniILeaf1gInt4= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Nick Alcock To: bfd-cvs@sourceware.org, gdb-cvs@sourceware.org Subject: [binutils-gdb] libctf: fix uninitialized variables in testsuite X-Act-Checkin: binutils-gdb X-Git-Author: Nick Alcock X-Git-Refname: refs/heads/master X-Git-Oldrev: 02b2f397039270cbe00f61097ed93b872723e1f4 X-Git-Newrev: 9b9e262994636841de04b433413e8987b16fcbaa Message-Id: <20240311171800.334933858D20@sourceware.org> Date: Mon, 11 Mar 2024 17:18:00 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D9b9e26299463= 6841de04b433413e8987b16fcbaa commit 9b9e262994636841de04b433413e8987b16fcbaa Author: Nick Alcock Date: Tue Jan 30 14:18:54 2024 +0000 libctf: fix uninitialized variables in testsuite =20 Just because a path is an error path doesn't mean the program terminates there if you don't ask it to. And we don't want to -- but that means we need to initialize the variables that are missed if an error happens= to *something*. Type ID 0 (unimplemented) will do: it'll induce further ECTF_BADID errors, but that's no bad thing. =20 libctf/ChangeLog: =20 * testsuite/libctf-writable/libctf-errors.c: Initialize variabl= es. Diff: --- libctf/testsuite/libctf-writable/libctf-errors.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libctf/testsuite/libctf-writable/libctf-errors.c b/libctf/test= suite/libctf-writable/libctf-errors.c index 71f8268cfad..2790b608396 100644 --- a/libctf/testsuite/libctf-writable/libctf-errors.c +++ b/libctf/testsuite/libctf-writable/libctf-errors.c @@ -12,7 +12,7 @@ main (int argc, char *argv[]) ctf_dict_t *fp; ctf_next_t *i =3D NULL; size_t boom =3D 0; - ctf_id_t itype, stype; + ctf_id_t itype =3D 0, stype =3D 0; ctf_encoding_t encoding =3D {0}; ctf_membinfo_t mi; ssize_t ret;