]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commit
esx_vi: fix possible segfault
authorPavel Hrdina <phrdina@redhat.com>
Wed, 21 Jan 2015 10:17:52 +0000 (11:17 +0100)
committerPavel Hrdina <phrdina@redhat.com>
Thu, 22 Jan 2015 17:30:18 +0000 (18:30 +0100)
commit3baeea6239636c59454f8d5ffe0d4dbde91518a9
tree664d250ec94830de6a6fad9f42ef662a2aaf3a43
parent828e485bd5dad0d9c49e0c11080db38b3bcc970c
esx_vi: fix possible segfault

Clang found possible dereference of NULL pointer which is right.
Function 'esxVI_LookupTaskInfoByTask' should find a task info. The issue
is that we could return 0 and leave 'taksInfo' pointer NULL because if
there is no match we simply end the search loop end set 'result' to 0.
Every caller count on the fact that if the return value is 0 than it's
safe to dereference 'taskInfo'. We should return 0 only in case we found
something and the '*taskInfo' is not NULL.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
src/esx/esx_vi.c