[PATCH v2 01/11] tlscontext: Make sure to get proper pointer to 'dname'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Keep Coverity happy by passing a pointer to 'dname' rather than the
array itself.  The PROBE expansion would cause a BAD_SIZEOF.
---
After all that we're back to this version without the (unknown).  I guess
that was my former world sneaking in - have to put something there.

 src/rpc/virnettlscontext.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/rpc/virnettlscontext.c b/src/rpc/virnettlscontext.c
index 0f0ddff..3e7e5e0 100644
--- a/src/rpc/virnettlscontext.c
+++ b/src/rpc/virnettlscontext.c
@@ -1,7 +1,7 @@
 /*
  * virnettlscontext.c: TLS encryption/x509 handling
  *
- * Copyright (C) 2010-2012 Red Hat, Inc.
+ * Copyright (C) 2010-2013 Red Hat, Inc.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -949,6 +949,7 @@ static int virNetTLSContextValidCertificate(virNetTLSContextPtr ctxt,
     const gnutls_datum_t *certs;
     unsigned int nCerts, i;
     char dname[256];
+    char *dnameptr = dname;
     size_t dnamesize = sizeof(dname);
 
     memset(dname, 0, dnamesize);
@@ -1062,14 +1063,14 @@ static int virNetTLSContextValidCertificate(virNetTLSContextPtr ctxt,
 
     PROBE(RPC_TLS_CONTEXT_SESSION_ALLOW,
           "ctxt=%p sess=%p dname=%s",
-          ctxt, sess, dname);
+          ctxt, sess, dnameptr);
 
     return 0;
 
 authdeny:
     PROBE(RPC_TLS_CONTEXT_SESSION_DENY,
           "ctxt=%p sess=%p dname=%s",
-          ctxt, sess, dname);
+          ctxt, sess, dnameptr);
 
     return -1;
 
-- 
1.7.11.7

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]