Bug 735660 - Field access results in a dereference of a null pointer (loaded from variable 'l_disk')
Summary: Field access results in a dereference of a null pointer (loaded from variable...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt
Version: 6.2
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Osier Yang
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-09-04 16:56 UTC by Alex Jia
Modified: 2011-09-09 06:53 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-09-08 06:38:57 UTC


Attachments (Terms of Use)

Description Alex Jia 2011-09-04 16:56:14 UTC
Description of problem:
File:	src/libxl/libxl_driver.c
Location:	line 3017, column 17
Description:	Field access results in a dereference of a null pointer (loaded from variable 'l_disk')

2979	static int
2980	libxlDomainDetachDeviceDiskLive(libxlDomainObjPrivatePtr priv,
2981	virDomainObjPtr vm, virDomainDeviceDefPtr dev)
2982	{
2983	virDomainDiskDefPtr l_disk = NULL;

Notes: Variable 'l_disk' initialized to a null pointer value.

2989	switch (dev->data.disk->device) {

Notes: Control jumps to 'case VIR_DOMAIN_DISK_DEVICE_DISK:' at line 2990
    
2990	case VIR_DOMAIN_DISK_DEVICE_DISK:
2991	if (dev->data.disk->bus == VIR_DOMAIN_DISK_BUS_XEN) {

Notes: Taking false branch

3016	} else {
3017	libxlError(VIR_ERR_CONFIG_UNSUPPORTED,
3018	_("disk bus '%s' cannot be hot unplugged."),
3019	virDomainDiskBusTypeToString(l_disk->bus));

Notes: 	Within the expansion of the macro 'libxlError':
        Field access results in a dereference of a null 
        pointer (loaded from variable 'l_disk')


Version-Release number of selected component (if applicable):
libvirt upstream.

How reproducible:
always

Steps to Reproduce:
1. directly analyze libvirt soure codes 
   or using static codes analysis tool such as clang. 
2. 
3.
  
Actual results:


Expected results:
Avoid a dereference of a null pointer.


Additional info:

Comment 1 Alex Jia 2011-09-04 16:59:13 UTC
Patch for upstream and wait for developers review:
http://www.redhat.com/archives/libvir-list/2011-September/msg00265.html

Alex


Note You need to log in before you can comment on or make changes to this bug.