Index: user/cperciva/freebsd-update-build/patches/10.1-RELEASE/39-SA-16:26.openssl =================================================================== --- user/cperciva/freebsd-update-build/patches/10.1-RELEASE/39-SA-16:26.openssl (nonexistent) +++ user/cperciva/freebsd-update-build/patches/10.1-RELEASE/39-SA-16:26.openssl (revision 306352) @@ -0,0 +1,19 @@ +--- crypto/openssl/crypto/bn/bn_print.c.orig ++++ crypto/openssl/crypto/bn/bn_print.c +@@ -141,14 +141,13 @@ + if (BN_is_negative(t)) + *p++ = '-'; + +- i = 0; + while (!BN_is_zero(t)) { ++ if (lp - bn_data >= bn_data_num) ++ goto err; + *lp = BN_div_word(t, BN_DEC_CONV); + if (*lp == (BN_ULONG)-1) + goto err; + lp++; +- if (lp - bn_data >= bn_data_num) +- goto err; + } + lp--; + /* Index: user/cperciva/freebsd-update-build/patches/10.2-RELEASE/22-SA-16:26.openssl =================================================================== --- user/cperciva/freebsd-update-build/patches/10.2-RELEASE/22-SA-16:26.openssl (nonexistent) +++ user/cperciva/freebsd-update-build/patches/10.2-RELEASE/22-SA-16:26.openssl (revision 306352) @@ -0,0 +1,19 @@ +--- crypto/openssl/crypto/bn/bn_print.c.orig ++++ crypto/openssl/crypto/bn/bn_print.c +@@ -141,14 +141,13 @@ + if (BN_is_negative(t)) + *p++ = '-'; + +- i = 0; + while (!BN_is_zero(t)) { ++ if (lp - bn_data >= bn_data_num) ++ goto err; + *lp = BN_div_word(t, BN_DEC_CONV); + if (*lp == (BN_ULONG)-1) + goto err; + lp++; +- if (lp - bn_data >= bn_data_num) +- goto err; + } + lp--; + /* Index: user/cperciva/freebsd-update-build/patches/10.3-RELEASE/9-SA-16:26.openssl =================================================================== --- user/cperciva/freebsd-update-build/patches/10.3-RELEASE/9-SA-16:26.openssl (nonexistent) +++ user/cperciva/freebsd-update-build/patches/10.3-RELEASE/9-SA-16:26.openssl (revision 306352) @@ -0,0 +1,19 @@ +--- crypto/openssl/crypto/bn/bn_print.c.orig ++++ crypto/openssl/crypto/bn/bn_print.c +@@ -141,14 +141,13 @@ + if (BN_is_negative(t)) + *p++ = '-'; + +- i = 0; + while (!BN_is_zero(t)) { ++ if (lp - bn_data >= bn_data_num) ++ goto err; + *lp = BN_div_word(t, BN_DEC_CONV); + if (*lp == (BN_ULONG)-1) + goto err; + lp++; +- if (lp - bn_data >= bn_data_num) +- goto err; + } + lp--; + /* Index: user/cperciva/freebsd-update-build/patches/9.3-RELEASE/47-SA-16:26.openssl =================================================================== --- user/cperciva/freebsd-update-build/patches/9.3-RELEASE/47-SA-16:26.openssl (nonexistent) +++ user/cperciva/freebsd-update-build/patches/9.3-RELEASE/47-SA-16:26.openssl (revision 306352) @@ -0,0 +1,19 @@ +--- crypto/openssl/crypto/bn/bn_print.c.orig ++++ crypto/openssl/crypto/bn/bn_print.c +@@ -141,14 +141,13 @@ + if (BN_is_negative(t)) + *p++ = '-'; + +- i = 0; + while (!BN_is_zero(t)) { ++ if (lp - bn_data >= bn_data_num) ++ goto err; + *lp = BN_div_word(t, BN_DEC_CONV); + if (*lp == (BN_ULONG)-1) + goto err; + lp++; +- if (lp - bn_data >= bn_data_num) +- goto err; + } + lp--; + /*