]> Git Repo - qemu.git/commitdiff
block/nfs: fix NULL pointer dereference in URI parsing
authorPeter Lieven <[email protected]>
Wed, 1 Feb 2017 09:53:48 +0000 (10:53 +0100)
committerMax Reitz <[email protected]>
Sat, 11 Feb 2017 23:47:42 +0000 (00:47 +0100)
parse_uint_full wants to put the parsed value into the
variable passed via its second argument which is NULL.

Fixes: 94d6a7a76e9df9919629428f6c598e2b97d9426c
Cc: [email protected]
Signed-off-by: Peter Lieven <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Message-id: 1485942829[email protected]
Signed-off-by: Max Reitz <[email protected]>
block/nfs.c

index a564340d1584500509f6139329b8daf1b92e3a7e..baaecff3fd291fac5aac90a4043d42bb6468ff51 100644 (file)
@@ -108,12 +108,13 @@ static int nfs_parse_uri(const char *filename, QDict *options, Error **errp)
     qdict_put(options, "path", qstring_from_str(uri->path));
 
     for (i = 0; i < qp->n; i++) {
+        unsigned long long val;
         if (!qp->p[i].value) {
             error_setg(errp, "Value for NFS parameter expected: %s",
                        qp->p[i].name);
             goto out;
         }
-        if (parse_uint_full(qp->p[i].value, NULL, 0)) {
+        if (parse_uint_full(qp->p[i].value, &val, 0)) {
             error_setg(errp, "Illegal value for NFS parameter: %s",
                        qp->p[i].name);
             goto out;
This page took 0.02743 seconds and 4 git commands to generate.