[libvirt] [PATCH] esx: Fix incorrect memory compare size in esxStoragePoolLookupByUUID

Wang King posted 1 patch 7 years ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/20170413021545.34076-1-king.wang@huawei.com
src/esx/esx_storage_backend_iscsi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[libvirt] [PATCH] esx: Fix incorrect memory compare size in esxStoragePoolLookupByUUID
Posted by Wang King 7 years ago
Use MD5_DIGEST_SIZE or VIR_UUID_BUFLEN rather than VIR_UUID_STRING_BUFLEN
when compare @uuid with @md5.
---
 src/esx/esx_storage_backend_iscsi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/esx/esx_storage_backend_iscsi.c b/src/esx/esx_storage_backend_iscsi.c
index 96b472e..b106c51 100644
--- a/src/esx/esx_storage_backend_iscsi.c
+++ b/src/esx/esx_storage_backend_iscsi.c
@@ -220,7 +220,7 @@ esxStoragePoolLookupByUUID(virConnectPtr conn,
          target; target = target->_next) {
         md5_buffer(target->iScsiName, strlen(target->iScsiName), md5);
 
-        if (memcmp(uuid, md5, VIR_UUID_STRING_BUFLEN) == 0)
+        if (memcmp(uuid, md5, VIR_UUID_BUFLEN) == 0)
             break;
     }
 
-- 
2.8.3


--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] esx: Fix incorrect memory compare size in esxStoragePoolLookupByUUID
Posted by John Ferlan 7 years ago

On 04/12/2017 10:15 PM, Wang King wrote:
> Use MD5_DIGEST_SIZE or VIR_UUID_BUFLEN rather than VIR_UUID_STRING_BUFLEN
> when compare @uuid with @md5.
> ---
>  src/esx/esx_storage_backend_iscsi.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 

ACK (and will push shortly)

John

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