Patchwork iscsi: fix segfault in url parsing

login
register
mail settings
Submitter Peter Lieven
Date Nov. 15, 2012, 2:42 p.m.
Message ID <50A4FF3E.4010209@dlhnet.de>
Download mbox | patch
Permalink /patch/199314/
State New
Headers show

Comments

Peter Lieven - Nov. 15, 2012, 2:42 p.m.
If an invalid URL is specified iscsi_get_error(iscsi) is called
with iscsi == NULL.

Signed-off-by: Peter Lieven <pl@kamp.de>
---
  block/iscsi.c |    3 +--
  1 file changed, 1 insertion(+), 2 deletions(-)

      }
ronniesahlberg@gmail.com - Nov. 15, 2012, 2:55 p.m.
Acked-By: ronniesahlberg@gmail.com

On Thu, Nov 15, 2012 at 6:42 AM, Peter Lieven <pl@dlhnet.de> wrote:
> If an invalid URL is specified iscsi_get_error(iscsi) is called
> with iscsi == NULL.
>
> Signed-off-by: Peter Lieven <pl@kamp.de>
> ---
>  block/iscsi.c |    3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/block/iscsi.c b/block/iscsi.c
> index d0b1a10..b5c3161 100644
> --- a/block/iscsi.c
> +++ b/block/iscsi.c
> @@ -947,8 +947,7 @@ static int iscsi_open(BlockDriverState *bs, const char
> *filename, int flags)
>
>      iscsi_url = iscsi_parse_full_url(iscsi, filename);
>      if (iscsi_url == NULL) {
> -        error_report("Failed to parse URL : %s %s", filename,
> -                     iscsi_get_error(iscsi));
> +        error_report("Failed to parse URL : %s", filename);
>          ret = -EINVAL;
>          goto out;
>      }
> --
> 1.7.9.5
>
Paolo Bonzini - Nov. 15, 2012, 4 p.m.
Il 15/11/2012 15:42, Peter Lieven ha scritto:
> If an invalid URL is specified iscsi_get_error(iscsi) is called
> with iscsi == NULL.
> 
> Signed-off-by: Peter Lieven <pl@kamp.de>

Applied to scsi-next branch, but next time please disable format=flowed
if you want to send patches with Thunderbird.  It mangles whitespace.

Paolo

> ---
>  block/iscsi.c |    3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/block/iscsi.c b/block/iscsi.c
> index d0b1a10..b5c3161 100644
> --- a/block/iscsi.c
> +++ b/block/iscsi.c
> @@ -947,8 +947,7 @@ static int iscsi_open(BlockDriverState *bs, const
> char *filename, int flags)
> 
>      iscsi_url = iscsi_parse_full_url(iscsi, filename);
>      if (iscsi_url == NULL) {
> -        error_report("Failed to parse URL : %s %s", filename,
> -                     iscsi_get_error(iscsi));
> +        error_report("Failed to parse URL : %s", filename);
>          ret = -EINVAL;
>          goto out;
>      }

Patch

diff --git a/block/iscsi.c b/block/iscsi.c
index d0b1a10..b5c3161 100644
--- a/block/iscsi.c
+++ b/block/iscsi.c
@@ -947,8 +947,7 @@  static int iscsi_open(BlockDriverState *bs, const 
char *filename, int flags)

      iscsi_url = iscsi_parse_full_url(iscsi, filename);
      if (iscsi_url == NULL) {
-        error_report("Failed to parse URL : %s %s", filename,
-                     iscsi_get_error(iscsi));
+        error_report("Failed to parse URL : %s", filename);
          ret = -EINVAL;
          goto out;