From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pj1-x102a.google.com (mail-pj1-x102a.google.com [IPv6:2607:f8b0:4864:20::102a]) by sourceware.org (Postfix) with ESMTPS id 8AF6F385C426 for ; Tue, 24 Mar 2020 22:32:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 8AF6F385C426 Received: by mail-pj1-x102a.google.com with SMTP id ck23so162956pjb.4 for ; Tue, 24 Mar 2020 15:32:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:user-agent; bh=j+q9lxZ4roZnQOl1ozN6As0iUYL5OoHKz0UEexlZxNg=; b=D9c907CV/RgsLMPL46L4I8U8wc2nciuubPTIrSqVnGyqXRgv6VwEde7mCegDiKOJXG BN+z0vk2FWM6iw9GK5GSYkObDNqov6ZzJS6viW82SgwPn4H8C8TR/YpKibhwNmB88pcX sb4feTjs6LzNFb+84zfecf6Dr8EJGfGOtaMqEpz+yWpgpvq1GSWDUy3CuukhVJNmPg7O 6skW5GbvedX5rOR895i0sA4pj38PZ+s3Od3Cw/gZtHYTD0XA33JteNA0t3ugPjAGRsUF gcH3yhOAyNF869JBxQ1GoTV9XbN6jL8uYF6iTOmjXs3cXtM/eogZwksBdHOrkxc2J6lj bRPg== X-Gm-Message-State: ANhLgQ1HIGru/tTz8WHZoVF5+T6YZAe+BoWNse92sAohiG5Kv6ZYb4vq eYaTJormHhqwhMW/wCWatRU= X-Google-Smtp-Source: ADFU+vtweOMmnNTBIlYOfzbEqEpURq23Zg7nnldCPUOtJB1QniVmBpYKvFHB3s/Gw9ZCyun8ld+k5w== X-Received: by 2002:a17:90b:1944:: with SMTP id nk4mr171565pjb.70.1585089140726; Tue, 24 Mar 2020 15:32:20 -0700 (PDT) Received: from bubble.grove.modra.org (158.106.96.58.static.exetel.com.au. [58.96.106.158]) by smtp.gmail.com with ESMTPSA id 189sm16958481pfg.170.2020.03.24.15.32.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Mar 2020 15:32:20 -0700 (PDT) Received: by bubble.grove.modra.org (Postfix, from userid 1000) id 58334806D7; Wed, 25 Mar 2020 09:02:16 +1030 (ACDT) Date: Wed, 25 Mar 2020 09:02:16 +1030 From: Alan Modra To: binutils@sourceware.org Cc: Sergey Belyashov Subject: Uninitialised memory read in z80-dis.c Message-ID: <20200324223216.GZ4583@bubble.grove.modra.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.9.4 (2018-02-28) X-Spam-Status: No, score=-28.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Mar 2020 22:32:22 -0000 objdump -d -m ez80-adl testcase: .byte 0x40,0xfd * z80-dis.c (suffix): Init mybuf. diff --git a/opcodes/z80-dis.c b/opcodes/z80-dis.c index b23e8e99fd..cd84044451 100644 --- a/opcodes/z80-dis.c +++ b/opcodes/z80-dis.c @@ -804,6 +804,7 @@ suffix (struct buffer *buf, disassemble_info *info, const char *txt) old_stream = info->stream; info->fprintf_func = (fprintf_ftype) &sprintf; info->stream = mybuf; + mybuf[0] = 0; buf->base++; if (print_insn_z80_buf (buf, info) >= 0) buf->n_used++; -- Alan Modra Australia Development Lab, IBM