aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Mayhew <smayhew@redhat.com>2020-07-15 13:50:44 -0400
committerSteve Dickson <steved@redhat.com>2020-07-17 09:51:23 -0400
commit213050a920d7d675eca24bc33262e55f184498ab (patch)
tree9a841abfadc5386a56aef1b09857ad6bdc79f92f
parent2694463567e85627bf7e37f46bd3458b27130080 (diff)
downloadnfs-utils-213050a920d7d675eca24bc33262e55f184498ab.tar.gz
nfsdcld: Fix a few Coverity Scan STRING_NULL errors
Signed-off-by: Scott Mayhew <smayhew@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
-rw-r--r--utils/nfsdcld/legacy.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/utils/nfsdcld/legacy.c b/utils/nfsdcld/legacy.c
index 1fb74d43..9e9f758d 100644
--- a/utils/nfsdcld/legacy.c
+++ b/utils/nfsdcld/legacy.c
@@ -48,7 +48,7 @@ legacy_load_clients_from_recdir(int *num_records)
int fd;
DIR *v4recovery;
struct dirent *entry;
- char recdirname[PATH_MAX];
+ char recdirname[PATH_MAX+1];
char buf[NFS4_OPAQUE_LIMIT];
char *nl;
@@ -64,6 +64,7 @@ legacy_load_clients_from_recdir(int *num_records)
}
close(fd);
/* the output from the proc file isn't null-terminated */
+ recdirname[PATH_MAX] = '\0';
nl = strchr(recdirname, '\n');
if (!nl)
return;
@@ -114,7 +115,7 @@ legacy_clear_recdir(void)
int fd;
DIR *v4recovery;
struct dirent *entry;
- char recdirname[PATH_MAX];
+ char recdirname[PATH_MAX+1];
char dirname[PATH_MAX];
char *nl;
@@ -130,6 +131,7 @@ legacy_clear_recdir(void)
}
close(fd);
/* the output from the proc file isn't null-terminated */
+ recdirname[PATH_MAX] = '\0';
nl = strchr(recdirname, '\n');
if (!nl)
return;