X-Git-Url: https://git.tokkee.org/?p=sysdb.git;a=blobdiff_plain;f=src%2Ftools%2Fsysdb%2Fcommand.c;fp=src%2Ftools%2Fsysdb%2Fcommand.c;h=81f679233d969ccb203f5f938c07e6d5f98fd693;hp=d30ec6084179a614fcf386cf87e3a9dcad9e0079;hb=a5673017588c548a6a8e4fcb1ec44ffc27816d06;hpb=ccfc35aa9bef471b1cb76c33b3aca2b4874f982b diff --git a/src/tools/sysdb/command.c b/src/tools/sysdb/command.c index d30ec60..81f6792 100644 --- a/src/tools/sysdb/command.c +++ b/src/tools/sysdb/command.c @@ -65,7 +65,13 @@ log_printer(sdb_strbuf_t *buf) static void data_printer(sdb_strbuf_t *buf) { - if (sdb_strbuf_len(buf) <= sizeof(uint32_t)) { + size_t len = sdb_strbuf_len(buf); + + if ((! len) || (len == sizeof(uint32_t))) { + /* empty command or empty reply */ + return; + } + else if (len < sizeof(uint32_t)) { printf("ERROR: Received a DATA message with invalid " "or missing data-type\n"); return;