aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlns <matzeton@googlemail.com>2019-01-16 12:15:30 +0100
committerlns <matzeton@googlemail.com>2019-01-16 12:15:30 +0100
commit04fb98e9543b096d730225a2db95ef3f28d7303a (patch)
tree3570cb20d9a7e78c24abcadcfb4624f3fa70e557
parent25ec6db0d446c406802f143c414d2a3bfbc94204 (diff)
fixed snprintf truncation warning
Signed-off-by: lns <matzeton@googlemail.com>
-rw-r--r--exec_crypter.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/exec_crypter.c b/exec_crypter.c
index 2ce4580..4a85deb 100644
--- a/exec_crypter.c
+++ b/exec_crypter.c
@@ -169,7 +169,8 @@ int main(int argc, char **argv) {
printf("\nExtracting payload size %u\n",
_exec_payload_size);
- snprintf(exec_path, sizeof exec_path, "%s_", new_path);
+ snprintf(exec_path, sizeof exec_path, "%.*s_",
+ (int) sizeof exec_path - 2, new_path);
exec_fd = open(exec_path, O_RDWR | O_CREAT,
S_IRWXU | S_IRWXG | S_IRWXO);