qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: QEMU Developers <qemu-devel@nongnu.org>,
	Pavel Dovgalyuk <pavel.dovgaluk@ispras.ru>
Subject: Re: [Qemu-devel] [PULL 02/18] replay: internal functions for replay log
Date: Fri, 11 May 2018 10:27:58 +0100	[thread overview]
Message-ID: <CAFEAcA8xPCQpXYPPbfizzXZ-7OzUXGUN4dyqrbM3_Vy27coDKw@mail.gmail.com> (raw)
In-Reply-To: <1446725643-82458-3-git-send-email-pbonzini@redhat.com>

On 5 November 2015 at 12:13, Paolo Bonzini <pbonzini@redhat.com> wrote:
> From: Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru>
>
> This patch adds functions to perform read and write operations
> with replay log.
>
> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>

> +void replay_put_byte(uint8_t byte)
> +{
> +    if (replay_file) {
> +        putc(byte, replay_file);
> +    }
> +}

> +uint8_t replay_get_byte(void)
> +{
> +    uint8_t byte = 0;
> +    if (replay_file) {
> +        byte = getc(replay_file);
> +    }
> +    return byte;
> +}

Coverity (CID 1390576) points out that this function isn't checking
the error return from getc(). That means we could incorrectly return
255 from here and then the return value from replay_get_dword would
be 0xffffffff, which is unfortunate if the place that's using
that uses it as a loop boundary.

Incidentally, is it worth adding something to our coverity model
to tell coverity that data from replay_get_byte() is not tainted?

thanks
-- PMM

  reply	other threads:[~2018-05-11  9:28 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-05 12:13 [Qemu-devel] [PULL 00/18] Record/replay core for 2.5-rc1 Paolo Bonzini
2015-11-05 12:13 ` [Qemu-devel] [PULL 01/18] replay: global variables and function stubs Paolo Bonzini
2015-11-05 12:13 ` [Qemu-devel] [PULL 02/18] replay: internal functions for replay log Paolo Bonzini
2018-05-11  9:27   ` Peter Maydell [this message]
2018-05-11  9:51     ` Paolo Bonzini
2018-05-11  9:56       ` Pavel Dovgalyuk
2018-05-14  6:34       ` Markus Armbruster
2015-11-05 12:13 ` [Qemu-devel] [PULL 03/18] replay: introduce mutex to protect the " Paolo Bonzini
2015-11-05 12:13 ` [Qemu-devel] [PULL 04/18] replay: introduce icount event Paolo Bonzini
2015-11-05 12:13 ` [Qemu-devel] [PULL 05/18] cpu-exec: allow temporary disabling icount Paolo Bonzini
2015-11-05 12:13 ` [Qemu-devel] [PULL 06/18] cpu: replay instructions sequence Paolo Bonzini
2015-11-05 12:13 ` [Qemu-devel] [PULL 07/18] replay: interrupts and exceptions Paolo Bonzini
2015-11-05 12:13 ` [Qemu-devel] [PULL 08/18] replay: asynchronous events infrastructure Paolo Bonzini
2015-11-05 12:13 ` [Qemu-devel] [PULL 09/18] replay: recording and replaying clock ticks Paolo Bonzini
2015-11-05 12:13 ` [Qemu-devel] [PULL 10/18] replay: shutdown event Paolo Bonzini
2015-11-05 12:13 ` [Qemu-devel] [PULL 11/18] icount: improve counting for record/replay Paolo Bonzini
2015-11-05 12:13 ` [Qemu-devel] [PULL 12/18] replay: checkpoints Paolo Bonzini
2015-11-05 12:13 ` [Qemu-devel] [PULL 13/18] bottom halves: introduce bh call function Paolo Bonzini
2015-11-05 12:13 ` [Qemu-devel] [PULL 14/18] replay: ptimer Paolo Bonzini
2015-11-05 12:14 ` [Qemu-devel] [PULL 15/18] replay: initialization and deinitialization Paolo Bonzini
2015-11-05 12:14 ` [Qemu-devel] [PULL 16/18] replay: replay blockers for devices Paolo Bonzini
2015-11-05 12:14 ` [Qemu-devel] [PULL 17/18] replay: command line options Paolo Bonzini
2015-11-05 12:14 ` [Qemu-devel] [PULL 18/18] replay: recording of the user input Paolo Bonzini
2015-11-05 14:00 ` [Qemu-devel] [PULL 00/18] Record/replay core for 2.5-rc1 Peter Maydell
2015-11-05 14:07   ` Paolo Bonzini
2015-11-06  5:10     ` Pavel Dovgaluk
  -- strict thread matches above, loose matches on Subject: below --
2015-11-04 16:17 [Qemu-devel] [PULL 00/18] Record/replay core for QEMU 2.4-rc1 Paolo Bonzini
2015-11-04 16:17 ` [Qemu-devel] [PULL 02/18] replay: internal functions for replay log Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAFEAcA8xPCQpXYPPbfizzXZ-7OzUXGUN4dyqrbM3_Vy27coDKw@mail.gmail.com \
    --to=peter.maydell@linaro.org \
    --cc=pavel.dovgaluk@ispras.ru \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).