From 80293efe578cd03279c5b7d9dbcdc7abfb0da65f Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Thu, 17 Feb 2022 17:09:21 -0500 Subject: [PATCH] Address coverity false-positives Technically, the fread won't reach the length index, but change the order anyway to reassure coverity. --- confluent_vtbufferd/vtbufferd.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/confluent_vtbufferd/vtbufferd.c b/confluent_vtbufferd/vtbufferd.c index 1f700c01..e89269b4 100644 --- a/confluent_vtbufferd/vtbufferd.c +++ b/confluent_vtbufferd/vtbufferd.c @@ -178,22 +178,22 @@ int main(int argc, char* argv[]) { length = cmd & 536870911; cmd = cmd >> 29; if (cmd == SETNODE) { - currnode[length] = 0; cmd = fread(currnode, 1, length, stdin); + currnode[length] = 0; if (cmd < 0) continue; currvt = set_termentbyname(currnode); } else if (cmd == WRITE) { if (currvt == NULL) currvt = set_termentbyname(""); - cmdbuf[length] = 0; cmd = fread(cmdbuf, 1, length, stdin); + cmdbuf[length] = 0; if (cmd < 0) continue; tmt_write(currvt, cmdbuf, length); } else if (cmd == READBUFF) { - cmdbuf[length] = 0; cmd = fread(cmdbuf, 1, length, stdin); + cmdbuf[length] = 0; if (cmd < 0) continue; outvt = get_termentbyname(cmdbuf);