Fix MDnsSdListener::Monitor::Monitor()
* Initialisation of mLiveCount The value of mLiveCount was being used without being initialised, and this was causing the CTS class android.net.wifi.cts.NsdManagerTest method testAndroidTestCaseSetupProperly test to fail when the calls to calloc in the MDnsSdListener::Monitor::rescan() method returned a value of NULL due to the large value of mPollSize, which had been set to "mLiveCount + 5". The mPollFds and mPollRefs pointers were then used without checking that they were not NULL, resulting in a segmentation violation when the NULL pointer value was dereferenced. Initialising the value of mLiveCount to zero in MDnsSdListener::Monitor::Monitor() fixes this problem, and the test then passes. * Also initilize mPollFds, mPollRefs and mPollSize Change-Id: I1a8f7ee0f3ed38f46854e9ba6d5c432c9412b7c3 Signed-off-by:Marcus Oakland <marcus.oakland@arm.com> Signed-off-by:
Kévin Petit <kevin.petit@arm.com>
Loading
Please register or sign in to comment