summaryrefslogtreecommitdiff
path: root/debian/patches/0001-prevent-null-truncation-by-strncpy.patch
diff options
context:
space:
mode:
Diffstat (limited to 'debian/patches/0001-prevent-null-truncation-by-strncpy.patch')
-rw-r--r--debian/patches/0001-prevent-null-truncation-by-strncpy.patch21
1 files changed, 21 insertions, 0 deletions
diff --git a/debian/patches/0001-prevent-null-truncation-by-strncpy.patch b/debian/patches/0001-prevent-null-truncation-by-strncpy.patch
new file mode 100644
index 0000000..1ad1e1b
--- /dev/null
+++ b/debian/patches/0001-prevent-null-truncation-by-strncpy.patch
@@ -0,0 +1,21 @@
+From: Alexander Ponyatykh <lazyranma@gmail.com>
+Date: Sat, 23 Nov 2019 20:53:58 +0300
+Subject: Prevent NULL truncation by strncpy
+
+---
+ paexec/paexec.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/paexec/paexec.c b/paexec/paexec.c
+index 9a1f19d..6558f6f 100644
+--- a/paexec/paexec.c
++++ b/paexec/paexec.c
+@@ -271,7 +271,7 @@ static void init__read_graph_tasks (void)
+ --len;
+ }
+
+- strncpy (buf_copy, buf, sizeof (buf_copy));
++ strncpy (buf_copy, buf, sizeof (buf_copy) - 1);
+
+ tok1 = tok2 = tok3 = tok = NULL;
+ tok_cnt = 0;