summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuel Mendoza-Jonas <sam@mendozajonas.com>2018-03-20 10:03:19 +1100
committerSamuel Mendoza-Jonas <sam@mendozajonas.com>2018-03-23 11:39:35 +1100
commitabf92c05c31955333719f1a83cffb0d0d194c770 (patch)
treea9cdbc13d53d87696599672ff620ecb140b48aad
parentfc04325dd218a391112483b7536d10dc9697675f (diff)
downloadtalos-petitboot-abf92c05c31955333719f1a83cffb0d0d194c770.zip
talos-petitboot-abf92c05c31955333719f1a83cffb0d0d194c770.tar.gz
lib/file: Avoid off-by-one error in array
Fixes Coverity defect CIDs 143606, 143610 Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
-rw-r--r--lib/file/file.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/file/file.c b/lib/file/file.c
index 0d18788..57a2519 100644
--- a/lib/file/file.c
+++ b/lib/file/file.c
@@ -37,7 +37,7 @@ int copy_file_secure_dest(void *ctx, const char *source_file,
char **destination_file)
{
char readlink_buffer[MAX_FILENAME_SIZE + 1];
- char dest_filename[MAX_FILENAME_SIZE] = "";
+ char dest_filename[MAX_FILENAME_SIZE + 1] = "";
char template[] = "/tmp/petitbootXXXXXX";
FILE *destination_handle, *source_handle;
int destination_fd, result = 0;
OpenPOWER on IntegriCloud