Fix strncpy to prevent truncation of source in tests Thanks: Corey Bryant
Ondřej Nový
4 years ago
|
0 |
liberasurecode (1.6.1-4) UNRELEASED; urgency=medium
|
|
1 |
|
|
2 |
* Fix strncpy to prevent truncation of source in tests.
|
|
3 |
(Thanks Corey Bryant)
|
|
4 |
|
|
5 |
-- Ondřej Nový <onovy@debian.org> Tue, 14 Jan 2020 22:10:54 +0100
|
|
6 |
|
0 | 7 |
liberasurecode (1.6.1-3) unstable; urgency=medium
|
1 | 8 |
|
2 | 9 |
* Running wrap-and-sort -bast.
|
|
0 |
From c11ff0aa58e79d96100bc92f69b76e25b6668031 Mon Sep 17 00:00:00 2001
|
|
1 |
From: Corey Bryant <corey.bryant@canonical.com>
|
|
2 |
Date: Tue, 14 Jan 2020 15:47:44 -0500
|
|
3 |
Subject: [PATCH] Fix strncpy to prevent truncation of source
|
|
4 |
Forwarded: https://review.opendev.org/#/c/702530/
|
|
5 |
|
|
6 |
Fix data_len argument in call to create_fake_frags_no_meta to
|
|
7 |
ensure strncpy copies the string plus the null terminator rather
|
|
8 |
than the string without the null terminator.
|
|
9 |
|
|
10 |
Change-Id: I50cd7922dfa377ea27f3c9558a8a7268120ec733
|
|
11 |
Closes-Bug: #1859710
|
|
12 |
---
|
|
13 |
|
|
14 |
diff --git a/test/liberasurecode_test.c b/test/liberasurecode_test.c
|
|
15 |
index d3ca200..154ad9b 100644
|
|
16 |
--- a/test/liberasurecode_test.c
|
|
17 |
+++ b/test/liberasurecode_test.c
|
|
18 |
@@ -697,7 +697,7 @@
|
|
19 |
|
|
20 |
// test with num_fragments < (k)
|
|
21 |
num_avail_frags = create_fake_frags_no_meta(&avail_frags, (null_args.k - 1),
|
|
22 |
- " ", 1);
|
|
23 |
+ " ", 2);
|
|
24 |
assert(num_avail_frags > 0);
|
|
25 |
rc = liberasurecode_decode(desc, avail_frags, num_avail_frags,
|
|
26 |
fake_data_len, 1,
|
|
0 |
Fix_strncpy_to_prevent_truncation_of_source.patch
|