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

Commit 9dab7d67 authored by Irfan Sheriff's avatar Irfan Sheriff
Browse files

Fix NPE

Supplicant sometimes reports 00:00:00:00:00:00 as group owner address causing
an NPE.

Avoid updating from peer list and let connection continue since group owner
address is not essential for data transfer to continue.

Bug: 8158711
Change-Id: I06ce88d7fb426fec4965087968f738dd2a7a7799
parent 080df3f3
Loading
Loading
Loading
Loading
+13 −4
Original line number Diff line number Diff line
@@ -1332,10 +1332,19 @@ public class WifiP2pService extends IWifiP2pManager.Stub {
                                P2pStateMachine.this, mGroup.getInterface());
                        mDhcpStateMachine.sendMessage(DhcpStateMachine.CMD_START_DHCP);
                        WifiP2pDevice groupOwner = mGroup.getOwner();
                        /* update group owner details with the ones found at discovery */
                        groupOwner.updateSupplicantDetails(mPeers.get(groupOwner.deviceAddress));
                        WifiP2pDevice peer = mPeers.get(groupOwner.deviceAddress);
                        if (peer != null) {
                            // update group owner details with peer details found at discovery
                            groupOwner.updateSupplicantDetails(peer);
                            mPeers.updateStatus(groupOwner.deviceAddress, WifiP2pDevice.CONNECTED);
                            sendPeersChangedBroadcast();
                        } else {
                            // A supplicant bug can lead to reporting an invalid
                            // group owner address (all zeroes) at times. Avoid a
                            // crash, but continue group creation since it is not
                            // essential.
                            logw("Unknown group owner " + groupOwner);
                        }
                    }
                    transitionTo(mGroupCreatedState);
                    break;