check for zero-length device ID
authorAndreas Steffen <andreas.steffen@strongswan.org>
Sun, 5 May 2013 08:13:13 +0000 (10:13 +0200)
committerAndreas Steffen <andreas.steffen@strongswan.org>
Fri, 21 Jun 2013 21:25:22 +0000 (23:25 +0200)
src/libimcv/plugins/imc_os/imc_os.c

index 98eac24..2558be9 100644 (file)
@@ -245,6 +245,12 @@ static void add_device_id(imc_msg_t *msg)
                                  "android_id" : "/var/lib/dbus/machine-id";
        value = os->get_setting(os, name);
 
+       if (value.len == 0)
+       {
+               DBG1(DBG_IMC, "no device ID available");
+               return;
+       }
+
        /* trim trailing newline character */
        if (value.ptr[value.len - 1] == '\n')
        {