24 lines
666 B
Diff
24 lines
666 B
Diff
From 534e6d555736b97211523970d378dfb0db2608e9 Mon Sep 17 00:00:00 2001
|
|
From: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com>
|
|
Date: Mon, 22 Feb 2021 21:44:07 -0800
|
|
Subject: [PATCH] tmpnam.c: fix heap overflow
|
|
|
|
Signed-off-by: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com>
|
|
---
|
|
src/tmpnam.c | 2 +-
|
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
|
|
diff --git a/src/tmpnam.c b/src/tmpnam.c
|
|
index ce60817..917ee6b 100644
|
|
--- a/src/tmpnam.c
|
|
+++ b/src/tmpnam.c
|
|
@@ -42,7 +42,7 @@ wrapper(tmpnam, char *, (char * s))
|
|
|
|
expand_chroot_path(ptr);
|
|
|
|
- ptr2 = malloc(strlen(ptr));
|
|
+ ptr2 = malloc(strlen(ptr) + 1);
|
|
if (ptr2 == NULL) return NULL;
|
|
|
|
strcpy(ptr2, ptr);
|