From: Ramakrishnan Muthukrishnan Date: Sun, 24 Jan 2016 05:11:44 +0000 (+0530) Subject: fec.c: add asserts for the preconditions that the inputs need to meet X-Git-Url: https://git.rkrishnan.org/pf/content/en/seg/bcase/statistics?a=commitdiff_plain;h=ccd68ce9e2eeb12507b658aaed01f9432c56a40d;p=tahoe-lafs%2Fzfec.git fec.c: add asserts for the preconditions that the inputs need to meet --- diff --git a/zfec/fec.c b/zfec/fec.c index b03bae1..4df0d98 100644 --- a/zfec/fec.c +++ b/zfec/fec.c @@ -418,6 +418,11 @@ fec_new(unsigned short k, unsigned short n) { fec_t *retval; + assert(k >= 1); + assert(n >= 1); + assert(n <= 256); + assert(k <= n); + if (fec_initialized == 0) init_fec ();