Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit ad71392a authored by Kévin Petit's avatar Kévin Petit
Browse files

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: default avatarMarcus Oakland <marcus.oakland@arm.com>
Signed-off-by: default avatarKévin Petit <kevin.petit@arm.com>
parent 100457df
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment