summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTim Burke <tim.burke@gmail.com>2017-07-13 16:54:20 -0700
committerTim Burke <tim.burke@gmail.com>2017-09-13 20:46:19 +0000
commitcf12c9ca26e4388e383f1aa3c1558d61eda96777 (patch)
treef10d678de7dedc73b675dac246a75833cb4e1917 /src
parent737843e14e7b29b122b7a55b1c1ab777bf83464f (diff)
downloadliberasurecode-cf12c9ca26e4388e383f1aa3c1558d61eda96777.tar.gz
flat_xor_hd: better validate args
Previously, we'd segfault with args like k=1, m=3, hd=3. Change-Id: I8a1d92f388c54fe4f5b357eaf85a27e6b334df11
Diffstat (limited to 'src')
-rw-r--r--src/builtin/xor_codes/xor_hd_code.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/builtin/xor_codes/xor_hd_code.c b/src/builtin/xor_codes/xor_hd_code.c
index 5c4d052..9e41ad1 100644
--- a/src/builtin/xor_codes/xor_hd_code.c
+++ b/src/builtin/xor_codes/xor_hd_code.c
@@ -664,7 +664,7 @@ xor_code_t* init_xor_hd_code(int k, int m, int hd)
if (k <= 10 && k >= 5) {
is_valid = 1;
}
- } else if (m == 3) {
+ } else if (m == 3 && k == 3) {
is_valid = 1;
}
}