[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] [PATCH 1/2] util: mdev: Use a local variable instead of an invalid pointer reference



On 04/28/2017 03:46 AM, Erik Skultety wrote:
> virMediatedDeviceListAdd calls VIR_APPEND_ELEMENT which normally clears
> the element to be added, thus the pointer must not be used afterwards,
> but because the pointer here is passed by value, what gets cleared is
> a copy of the original pointer that got created on the stack
> automatically when calling the function. The fact that it works now is
> just a coincidence and a bug in virMediatedDeviceListAdd that needs to
> be fixed in a separate commit. Therefore, use a local variable to hold
> data, rather than accessing the pointer later.
> 
> Signed-off-by: Erik Skultety <eskultet redhat com>

Reviewed-by: Laine Stump <laine laine org>


(Oh, and "safe for freeze", in case that wasn't assumed. Same goes for 2/2)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]