dropbear: libtommath: don't read uninitialised value
authorKonstantin Demin <rockdrilla@gmail.com>
Tue, 16 Oct 2018 13:31:36 +0000 (16:31 +0300)
committerHans Dedecker <dedeckeh@gmail.com>
Thu, 8 Nov 2018 10:07:05 +0000 (11:07 +0100)
cherry-pick upstream commit 145fb9698929d247dffb35189397a3daff497431

Signed-off-by: Konstantin Demin <rockdrilla@gmail.com>
package/network/services/dropbear/patches/005-libtommath-don-t-read-uninitialised-value.patch [new file with mode: 0644]

diff --git a/package/network/services/dropbear/patches/005-libtommath-don-t-read-uninitialised-value.patch b/package/network/services/dropbear/patches/005-libtommath-don-t-read-uninitialised-value.patch
new file mode 100644 (file)
index 0000000..25718d0
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/libtommath/bn_fast_s_mp_mul_digs.c
++++ b/libtommath/bn_fast_s_mp_mul_digs.c
+@@ -87,7 +87,7 @@ int fast_s_mp_mul_digs (mp_int * a, mp_i
+   {
+     mp_digit *tmpc;
+     tmpc = c->dp;
+-    for (ix = 0; ix < (pa + 1); ix++) {
++    for (ix = 0; ix < pa; ix++) {
+       /* now extract the previous digit [below the carry] */
+       *tmpc++ = W[ix];
+     }