]> xenbits.xensource.com Git - libvirt.git/commit
vz: fix crash when parsing unexpected disk configuration
authorMaxim Nestratov <mnestratov@virtuozzo.com>
Mon, 6 Jun 2016 15:54:23 +0000 (18:54 +0300)
committerMaxim Nestratov <mnestratov@virtuozzo.com>
Sat, 11 Jun 2016 15:21:15 +0000 (18:21 +0300)
commit85d54f133c3b811d06fd8d55702ead03385a8a56
tree9f6089253ccec9a1efd9192ce8000478556f15db
parentceb5461f7bd7b4ef104534e60f7201f5bc6f87f7
vz: fix crash when parsing unexpected disk configuration

As it turned out PrlVmDev_GetStackIndex can return negative values
without reporting an error, which is incorrect but nevertheless.
After that we feed this negative index to virIndexToDiskName,
which in turn returns NULL and we set it to virDomainDiskDef.dst.
Using virDiskNameToBusDeviceIndex with a virDomainDiskDef structure
which has NULL dst field crashes.
Fix this by returning an error in prlsdkGetDiskId in such cases.

Signed-off-by: Maxim Nestratov <mnestratov@virtuozzo.com>
src/vz/vz_sdk.c