From 05cc62dd504bbb0fb230fcf3786ed7f4d5be2364 Mon Sep 17 00:00:00 2001 From: Dave Wallace Date: Mon, 9 Oct 2023 18:05:47 -0400 Subject: vppinfra: fix coverity issue CID 323952 Type: fix Fixes: 08600ccfa Change-Id: I53ba0d96507b55ab7cd735073d6c4cf20a3cc948 Signed-off-by: Dave Wallace --- src/vppinfra/unix-misc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/vppinfra') 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--; -- cgit 1.2.3-korg