Skip to content

Commit

Permalink
Add extra checks when snopping devices
Browse files Browse the repository at this point in the history
  • Loading branch information
knro committed Jul 26, 2022
1 parent 15a9b44 commit 1325bf7
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions indidriver.c
Expand Up @@ -143,7 +143,7 @@ void IDDelete(const char *dev, const char *name, const char *fmt, ...)
void IDSnoopDevice(const char *snooped_device, const char *snooped_property)
{
// Ignore empty snooped device
if (snooped_device[0])
if (snooped_device && snooped_device[0])
{
driverio io;
driverio_init(&io);
Expand All @@ -160,13 +160,16 @@ void IDSnoopDevice(const char *snooped_device, const char *snooped_property)
*/
void IDSnoopBLOBs(const char *snooped_device, const char *snooped_property, BLOBHandling bh)
{
driverio io;
driverio_init(&io);
if (snooped_device && snooped_device[0])
{
driverio io;
driverio_init(&io);

userio_xmlv1(&io.userio, io.user);
IUUserIOEnableBLOB(&io.userio, io.user, snooped_device, snooped_property, bh);
userio_xmlv1(&io.userio, io.user);
IUUserIOEnableBLOB(&io.userio, io.user, snooped_device, snooped_property, bh);

driverio_finish(&io);
driverio_finish(&io);
}
}

/* Update property switches in accord with states and names. */
Expand Down

0 comments on commit 1325bf7

Please sign in to comment.