From: Dave Wallace Date: Mon, 9 Oct 2023 22:05:47 +0000 (-0400) Subject: vppinfra: fix coverity issue CID 323952 X-Git-Tag: v24.06-rc0~231 X-Git-Url: https://gerrit.fd.io/r/gitweb?a=commitdiff_plain;ds=sidebyside;h=05cc62dd504bbb0fb230fcf3786ed7f4d5be2364;p=vpp.git vppinfra: fix coverity issue CID 323952 Type: fix Fixes: 08600ccfa Change-Id: I53ba0d96507b55ab7cd735073d6c4cf20a3cc948 Signed-off-by: Dave Wallace --- diff --git a/src/vppinfra/unix-misc.c b/src/vppinfra/unix-misc.c index 2918fc32328..6a7328bd873 100644 --- a/src/vppinfra/unix-misc.c +++ b/src/vppinfra/unix-misc.c @@ -148,11 +148,11 @@ clib_file_get_resolved_basename (char *fmt, ...) r = readlink ((char *) link, buffer, sizeof (buffer) - 1); vec_free (link); - buffer[r] = 0; if (r < 1) return 0; + buffer[r] = 0; p = buffer + r - 1; while (p > buffer && p[-1] != '/') p--;