Patchwork [35/43] iscsi: fix segfault in url parsing

login
register
mail settings
Submitter Michael Roth
Date Dec. 3, 2012, 10:44 p.m.
Message ID <1354574681-28954-3-git-send-email-mdroth@linux.vnet.ibm.com>
Download mbox | patch
Permalink /patch/203473/
State New
Headers show

Comments

Michael Roth - Dec. 3, 2012, 10:44 p.m.
From: Peter Lieven <pl@dlhnet.de>

If an invalid URL is specified iscsi_get_error(iscsi) is called
with iscsi == NULL.

Signed-off-by: Peter Lieven <pl@kamp.de>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit 8da1e18b0cf46b6c95c88bbad1cc50d6dd1bef4b)

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 block/iscsi.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Patch

diff --git a/block/iscsi.c b/block/iscsi.c
index fb001b9..817196a 100644
--- a/block/iscsi.c
+++ b/block/iscsi.c
@@ -951,8 +951,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;
     }