All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: Max Reitz <mreitz@redhat.com>
Cc: qemu-block@nongnu.org, Kevin Wolf <kwolf@redhat.com>,
	Jeff Cody <jcody@redhat.com>, Peter Lieven <pl@kamp.de>,
	qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH for-2.9?] block/nfs: Do not strcmp() with NULL
Date: Tue, 11 Apr 2017 15:58:18 +0200	[thread overview]
Message-ID: <874lxvujut.fsf@dusky.pond.sub.org> (raw)
In-Reply-To: <20170411131327.10734-1-mreitz@redhat.com> (Max Reitz's message of "Tue, 11 Apr 2017 15:13:27 +0200")

Max Reitz <mreitz@redhat.com> writes:

> Parsing the URI is not required to give us a scheme; uri->scheme may be
> NULL.
>
> Signed-off-by: Max Reitz <mreitz@redhat.com>
> ---
>  block/nfs.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/block/nfs.c b/block/nfs.c
> index 0816678307..0c7d5619fe 100644
> --- a/block/nfs.c
> +++ b/block/nfs.c
> @@ -83,7 +83,7 @@ static int nfs_parse_uri(const char *filename, QDict *options, Error **errp)
>          error_setg(errp, "Invalid URI specified");
>          goto out;
>      }
> -    if (strcmp(uri->scheme, "nfs") != 0) {
> +    if (!uri->scheme || strcmp(uri->scheme, "nfs") != 0) {
>          error_setg(errp, "URI scheme must be 'nfs'");
>          goto out;
>      }

Consider g_strcmp0().

  parent reply	other threads:[~2017-04-11 13:58 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-11 13:13 [Qemu-devel] [PATCH for-2.9?] block/nfs: Do not strcmp() with NULL Max Reitz
2017-04-11 13:23 ` Kevin Wolf
2017-04-11 13:30 ` Peter Maydell
2017-04-11 13:53   ` Max Reitz
2017-04-11 13:58 ` Markus Armbruster [this message]
2017-04-11 13:59   ` Max Reitz

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=874lxvujut.fsf@dusky.pond.sub.org \
    --to=armbru@redhat.com \
    --cc=jcody@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=pl@kamp.de \
    --cc=qemu-block@nongnu.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.