]> git.proxmox.com Git - mirror_qemu.git/commitdiff
virtfs-proxy-helper: add missing long option terminator
authorStefan Hajnoczi <stefanha@redhat.com>
Mon, 30 Mar 2015 13:57:15 +0000 (14:57 +0100)
committerAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Tue, 16 Jun 2015 15:02:29 +0000 (20:32 +0530)
The getopt_long(3) long options array must have a zeroed terminator.

This patch solves a segmentation fault when an unknown command-line
option is encountered:

  $ fsdev/virtfs-proxy-helper --help
  Segmentation fault (core dumped)

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
fsdev/virtfs-proxy-helper.c

index a698e2dbb37b6e9363ae20e2af4a4be36ebf7c97..91e8b9b7f1cf8c00ef484122dbcb62520e1ef583 100644 (file)
@@ -49,6 +49,7 @@ static struct option helper_opts[] = {
     {"socket", required_argument, NULL, 's'},
     {"uid", required_argument, NULL, 'u'},
     {"gid", required_argument, NULL, 'g'},
+    {},
 };
 
 static bool is_daemon;