Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Unified Diff: nss/lib/freebl/mpi/mpi.c

Issue 1843333003: Update NSPR to 4.12 and NSS to 3.23 on iOS (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/nss.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: nss/lib/freebl/mpi/mpi.c
diff --git a/nss/lib/freebl/mpi/mpi.c b/nss/lib/freebl/mpi/mpi.c
index 84f9b97b63ea408c8a85ddd52b38b88ba12863f3..ac19ead44c885e476ba1fac15c9bf56caa7aba85 100644
--- a/nss/lib/freebl/mpi/mpi.c
+++ b/nss/lib/freebl/mpi/mpi.c
@@ -1336,7 +1336,7 @@ mp_err mp_sqrt(const mp_int *a, mp_int *b)
}
/* Copy result to output parameter */
- mp_sub_d(&x, 1, &x);
+ MP_CHECKOK(mp_sub_d(&x, 1, &x));
s_mp_exch(&x, b);
CLEANUP:
@@ -2959,8 +2959,12 @@ mp_err s_mp_mul_2d(mp_int *mp, mp_digit d)
dshift = d / MP_DIGIT_BIT;
bshift = d % MP_DIGIT_BIT;
/* bits to be shifted out of the top word */
- mask = ((mp_digit)~0 << (MP_DIGIT_BIT - bshift));
- mask &= MP_DIGIT(mp, MP_USED(mp) - 1);
+ if (bshift) {
+ mask = (mp_digit)~0 << (MP_DIGIT_BIT - bshift);
+ mask &= MP_DIGIT(mp, MP_USED(mp) - 1);
+ } else {
+ mask = 0;
+ }
if (MP_OKAY != (res = s_mp_pad(mp, MP_USED(mp) + dshift + (mask != 0) )))
return res;

Powered by Google App Engine
This is Rietveld 408576698