From: Richard Levitte Date: Thu, 11 Dec 2003 18:01:06 +0000 (+0000) Subject: To figure out if we're going outside the buffer, use the size of the buffer, X-Git-Tag: OpenSSL_0_9_7d~62 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=ffe966b0fadbcceb4bb0ac9e1a5a5f1e7c1cb390;p=oweals%2Fopenssl.git To figure out if we're going outside the buffer, use the size of the buffer, not the size of the integer used to index in said buffer. PR: 794 Notified by: Rhett Garber --- diff --git a/crypto/bio/b_print.c b/crypto/bio/b_print.c index 2cfc689dd6..0fd5e4ee2a 100644 --- a/crypto/bio/b_print.c +++ b/crypto/bio/b_print.c @@ -652,8 +652,8 @@ fmtfp( (caps ? "0123456789ABCDEF" : "0123456789abcdef")[intpart % 10]; intpart = (intpart / 10); - } while (intpart && (iplace < sizeof iplace)); - if (iplace == sizeof iplace) + } while (intpart && (iplace < sizeof iconvert)); + if (iplace == sizeof iconvert) iplace--; iconvert[iplace] = 0; @@ -664,7 +664,7 @@ fmtfp( : "0123456789abcdef")[fracpart % 10]; fracpart = (fracpart / 10); } while (fplace < max); - if (fplace == sizeof fplace) + if (fplace == sizeof fconvert) fplace--; fconvert[fplace] = 0;