]> git.rkrishnan.org Git - tahoe-lafs/zfec.git/commitdiff
fec.c: add asserts for the preconditions that the inputs need to meet
authorRamakrishnan Muthukrishnan <ram@rkrishnan.org>
Sun, 24 Jan 2016 05:11:44 +0000 (10:41 +0530)
committerRamakrishnan Muthukrishnan <ram@rkrishnan.org>
Sun, 24 Jan 2016 05:11:44 +0000 (10:41 +0530)
zfec/fec.c

index b03bae1f8c8ad5371e0610b8ce6cdfd93b2c8434..4df0d98de563fcf88fb44b2a288c4d9b9f3d0390 100644 (file)
@@ -418,6 +418,11 @@ fec_new(unsigned short k, unsigned short n) {
 
     fec_t *retval;
 
 
     fec_t *retval;
 
+    assert(k >= 1);
+    assert(n >= 1);
+    assert(n <= 256);
+    assert(k <= n);
+
     if (fec_initialized == 0)
         init_fec ();
 
     if (fec_initialized == 0)
         init_fec ();