]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
Fix a segfault when neither /etc/os-release not lsb_release is available.
authorVincent Bernat <bernat@luffy.cx>
Wed, 2 Nov 2011 14:25:09 +0000 (15:25 +0100)
committerVincent Bernat <bernat@luffy.cx>
Wed, 2 Nov 2011 14:27:17 +0000 (15:27 +0100)
Closes #11.

CHANGELOG
src/lldpd.c

index f95002d054be3ff52c423d291b419fd4af9d0b59..29f02f6e2a0f78d7fe184e6fd9fac410a8c96227 100644 (file)
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -8,6 +8,8 @@ lldpd (0.5.5)
     + Only grab DMI information once. Only uses DMI for x86 platform.
     + Padding issues with socket protocol. This introduces a change in
       the socket protocol!
+    + Fix a segfault when neither /etc/os-release nor lsb_release
+      are available.
 
 lldpd (0.5.4)
   * Features:
index f3e0d16e844fcc2c3c939821e8df8c343df14863..36ff4d8316624f9052065c8bceebfc124e9afe18 100644 (file)
@@ -1289,7 +1289,7 @@ lldpd_main(int argc, char *argv[])
        cfg->g_delay = LLDPD_TX_DELAY;
 
        /* Description */
-       if (!(cfg->g_advertise_version = advertise_version))
+       if (!(cfg->g_advertise_version = advertise_version) && lsb_release)
                /* Remove the \n */
                lsb_release[strlen(lsb_release) - 1] = '\0';
        cfg->g_lsb_release = lsb_release;