diff --git a/src/volume.c b/src/volume.c index 928cca3..202e443 100644 --- a/src/volume.c +++ b/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/src/xpath.c b/src/xpath.c index 0e19abd..40ec8a6 100644 --- a/src/xpath.c +++ b/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);