pinfo/0006-Fix-possible-buffer-overrun.patch
2023-12-22 02:10:51 +08:00

26 lines
772 B
Diff

From ca3ab82e4e203f47f83a8bac79b6275bd8521f1d Mon Sep 17 00:00:00 2001
From: "bas@zoetekouw.net" <bas@zoetekouw.net>
Date: Wed, 9 Aug 2017 12:22:39 +0200
Subject: [PATCH] Fix possible buffer overrun
---
src/manual.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/manual.c b/src/manual.c
index 431dd66..c5a1423 100644
--- a/src/manual.c
+++ b/src/manual.c
@@ -201,7 +201,7 @@ construct_manualname(char *buf, int which)
char *base = xmalloc(1024);
char *ptr;
int tmppos;
- strcpy(base, manual[manuallinks[which].line - 1]);
+ strncpy(base, manual[manuallinks[which].line - 1],1023);
strip_manual(base);
ptr = base + strlen(base) - 3;
while (((isalpha(*ptr)) ||(*ptr == '.') ||(*ptr == '_')) &&(ptr > base))
--
2.33.0