michaelrsweet / pappl

PAPPL - Printer Application Framework
https://www.msweet.org/pappl
Apache License 2.0
309 stars 49 forks source link

device-network.c: Fix crash in `pappl_dnssd_list()` with Avahi #319

Closed zdohnal closed 9 months ago

zdohnal commented 9 months ago

If PAPPL testsuite runs in isolated environment, e.g. in mock, we cannot generate Avahi client, because Avahi is not running. This causes _papplDNSSDInit() to return NULL, which is later sent into avahi_service_browser_new(), which uses assert() for this argument and make the binary crash if the input is NULL.

The crash makes the testsuite fail during the build, which is useful sanity check before the package is built.

michaelrsweet commented 9 months ago

This shouldn't cause a crash because the cupsDNSSD APIs are sane about NULL checking/ignoring. But happy to add this to short-circuit things...