mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Uemis downloader: avoid NULL pointer dereference
The Uemis downloader blindly just did a strstr on 'nds->name', even if there wasn't necessarily a dive location at all. Add the proper NULL pointer checks. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
d2db571b7a
commit
ad0806406b
1 changed files with 1 additions and 1 deletions
|
@ -1059,7 +1059,7 @@ static bool load_uemis_divespot(const char *mountpath, int divespot_id)
|
|||
static void get_uemis_divespot(const char *mountpath, int divespot_id, struct dive *dive)
|
||||
{
|
||||
struct dive_site *nds = get_dive_site_by_uuid(dive->dive_site_uuid);
|
||||
if (strstr(nds->name,"from Uemis")) {
|
||||
if (nds && nds->name && strstr(nds->name,"from Uemis")) {
|
||||
if (load_uemis_divespot(mountpath, divespot_id)) {
|
||||
/* get the divesite based on the diveid, this should give us
|
||||
* the newly created site
|
||||
|
|
Loading…
Add table
Reference in a new issue