diff --git a/pam_usb/src/volume.c b/pam_usb/src/volume.c index 928cca3..202e443 100644 --- a/pam_usb/src/volume.c +++ b/pam_usb/src/volume.c @@ -79,6 +79,11 @@ static LibHalVolume *pusb_volume_probe(t_pusb_options *opts, int maxtries = 0; int i; + if (!*(opts->device.volume_uuid)) + { + log_debug("No UUID configured for device\n"); + return (NULL); + } log_debug("Searching for volume with uuid %s\n", opts->device.volume_uuid); maxtries = ((opts->probe_timeout * 1000000) / 250000); for (i = 0; i < maxtries; ++i) diff --git a/pam_usb/src/xpath.c b/pam_usb/src/xpath.c index 0e19abd..40ec8a6 100644 --- a/pam_usb/src/xpath.c +++ b/pam_usb/src/xpath.c @@ -65,6 +65,12 @@ int pusb_xpath_get_string(xmlDocPtr doc, const char *path, node = result->nodesetval->nodeTab[0]->xmlChildrenNode; result_string = xmlNodeListGetString(doc, node, 1); + if (!result_string) + { + xmlXPathFreeObject(result); + log_debug("Empty value for %s\n", path); + return (0); + } if (strlen((const char *)result_string) + 1 > size) { xmlFree(result_string);