]> 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)
committerCole Robinson <crobinso@redhat.com>
Wed, 10 May 2017 19:33:45 +0000 (15:33 -0400)
Use MD5_DIGEST_SIZE or VIR_UUID_BUFLEN rather than VIR_UUID_STRING_BUFLEN
when compare @uuid with @md5.

(cherry picked from commit 77cc51a4820e27c42636c7072724d5eac73ead53)

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;
     }