mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Prevent possible NULL pointer dereference
Not sure if this will fix the crash for Henrik, but it's worth a try. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
13dbbd3085
commit
076d8966f0
1 changed files with 2 additions and 2 deletions
|
@ -498,9 +498,9 @@ static void dc_match_serial(void *_dc, const char *model, uint32_t deviceid, con
|
|||
|
||||
if (!deviceid)
|
||||
return;
|
||||
if (!model || strcasecmp(dc->model, model))
|
||||
if (!dc->model && (!model || strcasecmp(dc->model, model)))
|
||||
return;
|
||||
if (!serial || strcasecmp(dc->serial, serial))
|
||||
if (!dc->serial || !serial || strcasecmp(dc->serial, serial))
|
||||
return;
|
||||
dc->deviceid = deviceid;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue