index d30ec6084179a614fcf386cf87e3a9dcad9e0079..81f679233d969ccb203f5f938c07e6d5f98fd693 100644 (file)
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;