All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: Eric Sandeen <sandeen@sandeen.net>
Cc: Eric Sandeen <sandeen@redhat.com>, linux-xfs <linux-xfs@vger.kernel.org>
Subject: Re: [PATCH 3/3 V2] libfrog: handle NULL dir && blkdev in __fs_table_lookup_mount
Date: Tue, 27 Mar 2018 15:37:26 -0700	[thread overview]
Message-ID: <20180327223725.GH4818@magnolia> (raw)
In-Reply-To: <5b4e43a4-5090-0970-ef2c-20ad0df7a565@sandeen.net>

On Tue, Mar 27, 2018 at 05:33:11PM -0500, Eric Sandeen wrote:
> If neither dir nor blkdev is set, dpath never gets set,
> and then gets used (uninitalized) later on.
> 
> If we are asked where "nothing" is mounted, just return
> "nowhere."
> 
> Fixes-coverity-id: 1433615
> Fixes-coverity-id: 1433616
> Signed-off-by: Eric Sandeen <sandeen@redhat.com>

 mmmmmm  mmmm  m    m   mmm         m    m   mm   mmmmm  mmmmm m     m
     #" m"  "m ##  ## m"   "        #    #   ##   #   "# #   "# "m m"
   m#   #    # # ## # #   mm        #mmmm#  #  #  #mmm#" #mmm#"  "#"
  m"    #    # # "" # #    #        #    #  #mm#  #      #        #
 ##mmmm  #mm#  #    #  "mmm"        #    # #    # #      #        #
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>

--D

> ---
> 
> V2: wrappers prevent (sic) both being set, gracefully
> handle either of the sent-in paths being null.
> 
> diff --git a/libfrog/paths.c b/libfrog/paths.c
> index 318b48f..c7895e9 100644
> --- a/libfrog/paths.c
> +++ b/libfrog/paths.c
> @@ -98,6 +98,9 @@ __fs_table_lookup_mount(
>  	char		rpath[PATH_MAX];
>  	char		dpath[PATH_MAX];
>  
> +	if (!dir && !blkdev)
> +		return NULL;
> +
>  	if (dir && !realpath(dir, dpath))
>  		return NULL;
>  	if (blkdev && !realpath(blkdev, dpath))
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

      reply	other threads:[~2018-03-27 22:37 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-27 22:04 [PATCH 0/3] xfsprogs: misc coverity fixes Eric Sandeen
2018-03-27 22:08 ` [PATCH 1/3] xfs_scrub: synchronize error levels & logging Eric Sandeen
2018-03-27 22:14   ` Darrick J. Wong
2018-03-27 22:20     ` Eric Sandeen
2018-03-27 22:22       ` Darrick J. Wong
2018-03-27 22:27   ` [PATCH 1/3 V2] " Eric Sandeen
2018-03-27 22:31     ` Darrick J. Wong
2018-03-27 22:11 ` [PATCH 2/3] xfs_scrub: initialize movon in Eric Sandeen
2018-03-27 22:14   ` Darrick J. Wong
2018-03-27 22:14 ` [PATCH 3/3] libfrog: enforce dir XOR blkdev in __fs_table_lookup_mount Eric Sandeen
2018-03-27 22:19   ` Darrick J. Wong
2018-03-27 22:33   ` [PATCH 3/3 V2] libfrog: handle NULL dir && " Eric Sandeen
2018-03-27 22:37     ` Darrick J. Wong [this message]

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=20180327223725.GH4818@magnolia \
    --to=darrick.wong@oracle.com \
    --cc=linux-xfs@vger.kernel.org \
    --cc=sandeen@redhat.com \
    --cc=sandeen@sandeen.net \
    /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.