dm-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
From: Christophe Varoqui <christophe.varoqui@gmail.com>
To: michaelc@cs.wisc.edu
Cc: dm-devel <dm-devel@redhat.com>
Subject: Re: [PATCH 1/1] libmultipath: fix segfault when vector is null
Date: Wed, 09 Jan 2013 00:45:37 +0100	[thread overview]
Message-ID: <1357688737.12137.8.camel@lapoo.opensvc.com> (raw)
In-Reply-To: <1357673794-4894-1-git-send-email-michaelc@cs.wisc.edu>

On mar., 2013-01-08 at 13:36 -0600, michaelc@cs.wisc.edu wrote:
> From: Mike Christie <michaelc@cs.wisc.edu>
> 
> While performing tests that caused paths to get added
> and deleted, we hit a segfault. We traced it to the
> vector struct being NULL. This patch fixes the problem
> by checking for a NULL vector before accessing it.
> 
Applied.

Thanks,
Christophe Varoqui
www.opensvc.com

> Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
> ---
>  libmultipath/vector.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/libmultipath/vector.c b/libmultipath/vector.c
> index 652f118..0564224 100644
> --- a/libmultipath/vector.c
> +++ b/libmultipath/vector.c
> @@ -94,6 +94,9 @@ find_slot(vector v, void * addr)
>  {
>  	int i;
>  
> +	if (!v)
> +		return -1;
> +
>  	for (i = 0; i < (v->allocated / VECTOR_DEFAULT_SIZE); i++)
>  		if (v->slot[i] == addr)
>  			return i;

      reply	other threads:[~2013-01-08 23:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-08 19:36 [PATCH 1/1] libmultipath: fix segfault when vector is null michaelc
2013-01-08 23:45 ` Christophe Varoqui [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=1357688737.12137.8.camel@lapoo.opensvc.com \
    --to=christophe.varoqui@gmail.com \
    --cc=christophe.varoqui@opensvc.com \
    --cc=dm-devel@redhat.com \
    --cc=michaelc@cs.wisc.edu \
    /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).