From 165352cdcaea1a8953bc5452224bb9f8f7b1bd73 Mon Sep 17 00:00:00 2001 From: apio Date: Fri, 30 Dec 2022 11:13:55 +0100 Subject: [PATCH] Bounds checking :) --- src/util.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/util.c b/src/util.c index 5437ad6..64c3be9 100644 --- a/src/util.c +++ b/src/util.c @@ -1,5 +1,6 @@ #include "minitar.h" #include "tar.h" +#include #include #include #include @@ -93,6 +94,7 @@ static size_t minitar_align_down_to_block_size(size_t size) static char* minitar_static_dup(const char* str, size_t size) { static char result[1024]; + assert(size < 1024); memcpy(result, str, size); result[size] = 0; return result;