mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
Second attempt to fix crash
Linus pointed out that it might be another call site (and looking at his proposed patch I noticed a logic error in my earlier attempt) Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
92caf2771b
commit
c809a8873c
2 changed files with 2 additions and 2 deletions
|
@ -193,7 +193,7 @@ static void match_id(void *_dc, const char *model, uint32_t deviceid,
|
|||
|
||||
if (dc->deviceid != deviceid)
|
||||
return;
|
||||
if (strcmp(dc->model, model))
|
||||
if (!model || !dc->model || strcmp(dc->model, model))
|
||||
return;
|
||||
|
||||
if (serial && !dc->serial)
|
||||
|
|
|
@ -498,7 +498,7 @@ static void dc_match_serial(void *_dc, const char *model, uint32_t deviceid, con
|
|||
|
||||
if (!deviceid)
|
||||
return;
|
||||
if (!dc->model && (!model || strcasecmp(dc->model, model)))
|
||||
if (!dc->model || !model || strcasecmp(dc->model, model))
|
||||
return;
|
||||
if (!dc->serial || !serial || strcasecmp(dc->serial, serial))
|
||||
return;
|
||||
|
|
Loading…
Reference in a new issue