summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKota Tsuyuzaki <tsuyuzaki.kota@lab.ntt.co.jp>2016-10-18 02:10:01 -0700
committerPete Zaitcev <zaitcev@kotori.zaitcev.us>2016-11-04 18:42:11 +0000
commite8b5a64d8d68c6f379fcd8aa69d934682b9e1a25 (patch)
tree4a7d290a0bc89e14b9a0958536ac102c0e4538c3 /src
parentcb0daba975dfb3b7bffe402d7aa73fac19180f73 (diff)
downloadliberasurecode-e8b5a64d8d68c6f379fcd8aa69d934682b9e1a25.tar.gz
Fix liberasurecode skipping a bunch of invalid_args tests
Since the commit a01b1818c874a65d1d1fb8f11ea441e9d3e18771, we have been to able to test some parameters for each tests. However, instead, the NULL which means the end of the test parameters causes skipping a bunch of unit tests which doesn't take args (e.g. test_create_backend_invalid_args). That is the worse because we have not tested anymore for the tests since the commit. This patch fixes to make it tested and more, fix a minor bug for a case that corrupted header incomming to get_metadata. Closes-Bug: #1634403 Change-Id: Ib99a8aa6032f02d0c7d1ab94b8da1ebfd9047d74
Diffstat (limited to 'src')
-rw-r--r--src/erasurecode.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/erasurecode.c b/src/erasurecode.c
index 31fc884..33acf26 100644
--- a/src/erasurecode.c
+++ b/src/erasurecode.c
@@ -1072,6 +1072,9 @@ int is_invalid_fragment_header(fragment_header_t *header)
{
uint32_t *stored_csum = NULL, csum = 0;
assert (NULL != header);
+ if (header->libec_version == 0)
+ /* libec_version must be bigger than 0 */
+ return 1;
if (header->libec_version < _VERSION(1,2,0))
/* no metadata checksum support */
return 0;