]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
daemon/lldpd: handle empty case for PRETTY_NAME
authorVincent Bernat <vincent@bernat.ch>
Sun, 26 Oct 2025 10:37:59 +0000 (11:37 +0100)
committerVincent Bernat <vincent@bernat.ch>
Sun, 26 Oct 2025 10:37:59 +0000 (11:37 +0100)
Again, fix #751.

src/daemon/lldpd.c

index a4f1a8af46f62e60af68f1675f16aecaaafc04c1..73725d3e732a82b5b9f32c39c89a87b7fc037c24 100644 (file)
@@ -872,7 +872,7 @@ lldpd_get_os_release()
 
        /* Remove trailing newline and all " in the string. */
        ptr1 = release + strlen(release);
-       while (ptr1 != release && ((*ptr1 == '"') || (*ptr1 == '\n'))) {
+       while (ptr1 != release && ((*ptr1 == '"') || (*ptr1 == '\n') || (*ptr1 == '\0'))) {
                *ptr1 = '\0';
                ptr1--;
        }