{"action":"created","issue":{"url":"https://api.github.com/repos/ArduPilot/ardupilot/issues/7099","repository_url":"https://api.github.com/repos/ArduPilot/ardupilot","labels_url":"https://api.github.com/repos/ArduPilot/ardupilot/issues/7099/labels{/name}","comments_url":"https://api.github.com/repos/ArduPilot/ardupilot/issues/7099/comments","events_url":"https://api.github.com/repos/ArduPilot/ardupilot/issues/7099/events","html_url":"https://github.com/ArduPilot/ardupilot/issues/7099","id":267282671,"number":7099,"title":"AP_Beacon_Marvelmind: Low memory when allocating can lead to dereferencing nullptr","user":{"login":"WickedShell","id":567688,"avatar_url":"https://avatars2.githubusercontent.com/u/567688?v=4","gravatar_id":"","url":"https://api.github.com/users/WickedShell","html_url":"https://github.com/WickedShell","followers_url":"https://api.github.com/users/WickedShell/followers","following_url":"https://api.github.com/users/WickedShell/following{/other_user}","gists_url":"https://api.github.com/users/WickedShell/gists{/gist_id}","starred_url":"https://api.github.com/users/WickedShell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WickedShell/subscriptions","organizations_url":"https://api.github.com/users/WickedShell/orgs","repos_url":"https://api.github.com/users/WickedShell/repos","events_url":"https://api.github.com/users/WickedShell/events{/privacy}","received_events_url":"https://api.github.com/users/WickedShell/received_events","type":"User","site_admin":false},"labels":[{"id":208947406,"url":"https://api.github.com/repos/ArduPilot/ardupilot/labels/AllVehicles","name":"AllVehicles","color":"bfd4f2","default":false},{"id":24259148,"url":"https://api.github.com/repos/ArduPilot/ardupilot/labels/BUG","name":"BUG","color":"fc2929","default":false},{"id":425709688,"url":"https://api.github.com/repos/ArduPilot/ardupilot/labels/Driver","name":"Driver","color":"006b75","default":false},{"id":136051782,"url":"https://api.github.com/repos/ArduPilot/ardupilot/labels/Library","name":"Library","color":"f7c6c7","default":false}],"state":"closed","locked":false,"assignee":{"login":"amilcarlucas","id":24453563,"avatar_url":"https://avatars1.githubusercontent.com/u/24453563?v=4","gravatar_id":"","url":"https://api.github.com/users/amilcarlucas","html_url":"https://github.com/amilcarlucas","followers_url":"https://api.github.com/users/amilcarlucas/followers","following_url":"https://api.github.com/users/amilcarlucas/following{/other_user}","gists_url":"https://api.github.com/users/amilcarlucas/gists{/gist_id}","starred_url":"https://api.github.com/users/amilcarlucas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amilcarlucas/subscriptions","organizations_url":"https://api.github.com/users/amilcarlucas/orgs","repos_url":"https://api.github.com/users/amilcarlucas/repos","events_url":"https://api.github.com/users/amilcarlucas/events{/privacy}","received_events_url":"https://api.github.com/users/amilcarlucas/received_events","type":"User","site_admin":false},"assignees":[{"login":"amilcarlucas","id":24453563,"avatar_url":"https://avatars1.githubusercontent.com/u/24453563?v=4","gravatar_id":"","url":"https://api.github.com/users/amilcarlucas","html_url":"https://github.com/amilcarlucas","followers_url":"https://api.github.com/users/amilcarlucas/followers","following_url":"https://api.github.com/users/amilcarlucas/following{/other_user}","gists_url":"https://api.github.com/users/amilcarlucas/gists{/gist_id}","starred_url":"https://api.github.com/users/amilcarlucas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amilcarlucas/subscriptions","organizations_url":"https://api.github.com/users/amilcarlucas/orgs","repos_url":"https://api.github.com/users/amilcarlucas/repos","events_url":"https://api.github.com/users/amilcarlucas/events{/privacy}","received_events_url":"https://api.github.com/users/amilcarlucas/received_events","type":"User","site_admin":false}],"milestone":null,"comments":5,"created_at":"2017-10-20T19:37:22Z","updated_at":"2017-11-03T11:15:55Z","closed_at":"2017-11-01T01:49:12Z","author_association":"CONTRIBUTOR","body":"#### Issue details\r\nWhen allocating the `AP_Beacon_Marvelmind` instance, an instance of `MarvelmindHedge` needs to be allocated as [well](https://github.com/ArduPilot/ardupilot/blob/2fcb4932b70f9a851731d3ab9c4d543b6e944810/libraries/AP_Beacon/AP_Beacon_Marvelmind.cpp#L33), this can fail however, but AP_Beacon is unaware that the allocation of the hedge object failed. The rest of `AP_Beacon_Marvelmind` is unaware of the possibility that the hedge object was not allocated, and will happily dereference a nullptr.\r\n\r\nAP_Beacon needs to check that the `AP_Beacon_Marvelmind` instance actually managed to create it's members and delete it if not. (The easiest way is to probably move to a `bool AP_Beacon_Marvelmind::init(void)` approach which if it fails AP_Beacon can use to indicate that the driver should be deleted.\r\n\r\n#### Version\r\nMaster\r\n\r\n#### Platform\r\n[  ] All\r\n[  ] AntennaTracker\r\n[ x ] Copter\r\n[  ] Plane\r\n[  ] Rover\r\n[  ] Submarine\r\n\r\n#### Hardware type\r\nMarvelmind\r\n"},"comment":{"url":"https://api.github.com/repos/ArduPilot/ardupilot/issues/comments/341676643","html_url":"https://github.com/ArduPilot/ardupilot/issues/7099#issuecomment-341676643","issue_url":"https://api.github.com/repos/ArduPilot/ardupilot/issues/7099","id":341676643,"user":{"login":"magicrub","id":4782875,"avatar_url":"https://avatars2.githubusercontent.com/u/4782875?v=4","gravatar_id":"","url":"https://api.github.com/users/magicrub","html_url":"https://github.com/magicrub","followers_url":"https://api.github.com/users/magicrub/followers","following_url":"https://api.github.com/users/magicrub/following{/other_user}","gists_url":"https://api.github.com/users/magicrub/gists{/gist_id}","starred_url":"https://api.github.com/users/magicrub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/magicrub/subscriptions","organizations_url":"https://api.github.com/users/magicrub/orgs","repos_url":"https://api.github.com/users/magicrub/repos","events_url":"https://api.github.com/users/magicrub/events{/privacy}","received_events_url":"https://api.github.com/users/magicrub/received_events","type":"User","site_admin":false},"created_at":"2017-11-03T11:15:55Z","updated_at":"2017-11-03T11:15:55Z","author_association":"CONTRIBUTOR","body":"related to: https://github.com/ArduPilot/ardupilot/pull/6474"}}
{"actor":{"display_login":"magicrub"}}