]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
client: fix segfault when displaying some information 0.8.0
authorVincent Bernat <vincent@bernat.im>
Tue, 29 Dec 2015 08:41:40 +0000 (09:41 +0100)
committerVincent Bernat <vincent@bernat.im>
Tue, 29 Dec 2015 08:41:40 +0000 (09:41 +0100)
Due to 5ed4156c02b0ba801feb9bf383d9b7772dc990e5, we were incorrectly
hiding information when it was present and displaying it when it was
absent (leading to a segfault).

Closes #152

src/client/writer.h

index 18737801740ece8253484225857c77b71a687335..c664a14d08ffee150b295c895c6d3ad88c3e1c4c 100644 (file)
@@ -33,7 +33,7 @@ struct writer {
 #define tag_attr(w,...)                w->attr(w,## __VA_ARGS__)
 #define tag_data(w,...)                w->data(w,## __VA_ARGS__)
 #define tag_end(w,...)         w->end(w,## __VA_ARGS__)
-#define tag_datatag(w,t,d,v)   do { if ((v) != NULL) break; w->start(w,t,d); w->data(w,v); w->end(w); } while(0);
+#define tag_datatag(w,t,d,v)   do { if ((v) == NULL) break; w->start(w,t,d); w->data(w,v); w->end(w); } while(0);
 
 extern struct writer * txt_init( FILE * );
 extern struct writer * kv_init( FILE * );