Fixed segfault in mpi_shift_r(), Fixed memory leak in test_suite_mpi
(cherry picked from commit e44ec108bea03837fa72714ca33e6dc557c1189b)
diff --git a/library/bignum.c b/library/bignum.c
index 4518d4a..acaba6a 100644
--- a/library/bignum.c
+++ b/library/bignum.c
@@ -609,6 +609,9 @@
     v0 = count /  biL;
     v1 = count & (biL - 1);
 
+    if( v0 > X->n || ( v0 == X->n && v1 > 0 ) )
+        return mpi_lset( X, 0 );
+
     /*
      * shift by count / limb_size
      */