[PATCH libvirt-snmp 1/3] allocate enough space for trailing NULL in string

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

 



This bug was found by coverity. See:

  https://bugzilla.redhat.com/show_bug.cgi?id=732015
---
 src/libvirtGuestTable_data_get.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/libvirtGuestTable_data_get.c b/src/libvirtGuestTable_data_get.c
index 2430f9c..cc31e9e 100644
--- a/src/libvirtGuestTable_data_get.c
+++ b/src/libvirtGuestTable_data_get.c
@@ -201,7 +201,7 @@ libvirtGuestName_get( libvirtGuestTable_rowreq_ctx *rowreq_ctx, char **libvirtGu
     if (!rowreq_ctx->data.libvirtGuestName)
     	return MFD_SKIP;
 
-    len = strlen(rowreq_ctx->data.libvirtGuestName);
+    len = strlen(rowreq_ctx->data.libvirtGuestName) + 1;
     if ((NULL == (* libvirtGuestName_val_ptr_ptr )) ||
         ((* libvirtGuestName_val_ptr_len_ptr ) < len)) {
         /*
-- 
1.7.6.4

--
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]