chiark / gitweb /
bus: convert a bus error with NULL name into an errno of 0 in sd_bus_error_get_errno()
authorLennart Poettering <lennart@poettering.net>
Fri, 10 Jan 2014 05:35:12 +0000 (13:35 +0800)
committerLennart Poettering <lennart@poettering.net>
Fri, 10 Jan 2014 05:35:51 +0000 (13:35 +0800)
src/libsystemd-bus/bus-error.c

index 35bd4f0..c2e41fb 100644 (file)
@@ -285,6 +285,9 @@ _public_ int sd_bus_error_get_errno(const sd_bus_error* e) {
         if (!e)
                 return 0;
 
+        if (!e->name)
+                return 0;
+
         return bus_error_name_to_errno(e->name);
 }