]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
esx: Fix incorrect memory compare size in esxStoragePoolLookupByUUID
authorWang King <king.wang@huawei.com>
Thu, 13 Apr 2017 02:15:45 +0000 (10:15 +0800)
committerJohn Ferlan <jferlan@redhat.com>
Thu, 13 Apr 2017 12:14:54 +0000 (08:14 -0400)
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

index 96b472ee07772a33b9e13a7f11305abe66be320a..b106c517e8d5deb06ae70979d0c4c42e6223f634 100644 (file)
@@ -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;
     }