qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/2] libcacard coverity found fixes
@ 2011-10-23 14:58 Alon Levy
  2011-10-23 14:58 ` [Qemu-devel] [PATCH 1/2] libcacard/cac: fix typo in cac_delete_pki_applet_private Alon Levy
  2011-10-23 14:58 ` [Qemu-devel] [PATCH 2/2] libcacard/vscclient: fix error paths for socket creation Alon Levy
  0 siblings, 2 replies; 3+ messages in thread
From: Alon Levy @ 2011-10-23 14:58 UTC (permalink / raw)
  To: qemu-devel

Two fixes, the first means memory for a vcard applet was never freed,
the second fixes vscclient handling of errors when opening it's socket.

Alon Levy (2):
  libcacard/cac: fix typo in cac_delete_pki_applet_private
  libcacard/vscclient: fix error paths for socket creation

 libcacard/cac.c       |    3 ++-
 libcacard/vscclient.c |    9 +++++++--
 2 files changed, 9 insertions(+), 3 deletions(-)

-- 
1.7.6.4

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Qemu-devel] [PATCH 1/2] libcacard/cac: fix typo in cac_delete_pki_applet_private
  2011-10-23 14:58 [Qemu-devel] [PATCH 0/2] libcacard coverity found fixes Alon Levy
@ 2011-10-23 14:58 ` Alon Levy
  2011-10-23 14:58 ` [Qemu-devel] [PATCH 2/2] libcacard/vscclient: fix error paths for socket creation Alon Levy
  1 sibling, 0 replies; 3+ messages in thread
From: Alon Levy @ 2011-10-23 14:58 UTC (permalink / raw)
  To: qemu-devel

Signed-off-by: Alon Levy <alevy@redhat.com>
---
 libcacard/cac.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/libcacard/cac.c b/libcacard/cac.c
index f4b0b1b..927a4ca 100644
--- a/libcacard/cac.c
+++ b/libcacard/cac.c
@@ -266,7 +266,8 @@ static void
 cac_delete_pki_applet_private(VCardAppletPrivate *applet_private)
 {
     CACPKIAppletData *pki_applet_data = NULL;
-    if (pki_applet_data == NULL) {
+
+    if (applet_private == NULL) {
         return;
     }
     pki_applet_data = &(applet_private->u.pki_data);
-- 
1.7.6.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [Qemu-devel] [PATCH 2/2] libcacard/vscclient: fix error paths for socket creation
  2011-10-23 14:58 [Qemu-devel] [PATCH 0/2] libcacard coverity found fixes Alon Levy
  2011-10-23 14:58 ` [Qemu-devel] [PATCH 1/2] libcacard/cac: fix typo in cac_delete_pki_applet_private Alon Levy
@ 2011-10-23 14:58 ` Alon Levy
  1 sibling, 0 replies; 3+ messages in thread
From: Alon Levy @ 2011-10-23 14:58 UTC (permalink / raw)
  To: qemu-devel

Signed-off-by: Alon Levy <alevy@redhat.com>
---
 libcacard/vscclient.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/libcacard/vscclient.c b/libcacard/vscclient.c
index 2191f60..e317a25 100644
--- a/libcacard/vscclient.c
+++ b/libcacard/vscclient.c
@@ -357,6 +357,7 @@ connect_to_qemu(
     if (sock < 0) {
         /* Error */
         fprintf(stderr, "Error opening socket!\n");
+        return -1;
     }
 
     memset(&hints, 0, sizeof(struct addrinfo));
@@ -370,13 +371,13 @@ connect_to_qemu(
     if (ret != 0) {
         /* Error */
         fprintf(stderr, "getaddrinfo failed\n");
-        return 5;
+        return -1;
     }
 
     if (connect(sock, server->ai_addr, server->ai_addrlen) < 0) {
         /* Error */
         fprintf(stderr, "Could not connect\n");
-        return 5;
+        return -1;
     }
     if (verbose) {
         printf("Connected (sizeof Header=%zd)!\n", sizeof(VSCMsgHeader));
@@ -505,6 +506,10 @@ main(
     qemu_host = strdup(argv[argc - 2]);
     qemu_port = strdup(argv[argc - 1]);
     sock = connect_to_qemu(qemu_host, qemu_port);
+    if (sock == -1) {
+        fprintf(stderr, "error opening socket, exiting.\n");
+        exit(5);
+    }
 
     qemu_mutex_init(&write_lock);
     qemu_mutex_init(&pending_reader_lock);
-- 
1.7.6.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-10-23 15:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-23 14:58 [Qemu-devel] [PATCH 0/2] libcacard coverity found fixes Alon Levy
2011-10-23 14:58 ` [Qemu-devel] [PATCH 1/2] libcacard/cac: fix typo in cac_delete_pki_applet_private Alon Levy
2011-10-23 14:58 ` [Qemu-devel] [PATCH 2/2] libcacard/vscclient: fix error paths for socket creation Alon Levy

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).