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:
Dirk Hohndel 2016-09-20 06:39:54 -07:00
parent 13dbbd3085
commit 076d8966f0

View file

@ -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;
}