diff mbox series

[2/2] lib/file: Avoid off-by-one error in array

Message ID 20180320024622.4435-2-sam@mendozajonas.com
State Accepted
Headers show
Series [1/2] discover/pxe-parser: Avoid potential null dereference | expand

Commit Message

Sam Mendoza-Jonas March 20, 2018, 2:46 a.m. UTC
Fixes Coverity defect CIDs 143606, 143610

Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
---
 lib/file/file.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

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;