aboutsummaryrefslogtreecommitdiff
path: root/openssl/crypto/bio/b_print.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2015-04-20 23:05:23 +0200
committermarha <marha@users.sourceforge.net>2015-04-20 23:05:23 +0200
commit0f7871ff824bcf064db3ab6bdfe26645ba6c8087 (patch)
tree90d3d2b6112e083289c9cf68146852087814f6d3 /openssl/crypto/bio/b_print.c
parent934184bfecd402aae891b8740d788b486aa7269f (diff)
parent2a00e489122f6c4b525090dbdba2855a2ea2d519 (diff)
downloadvcxsrv-0f7871ff824bcf064db3ab6bdfe26645ba6c8087.tar.gz
vcxsrv-0f7871ff824bcf064db3ab6bdfe26645ba6c8087.tar.bz2
vcxsrv-0f7871ff824bcf064db3ab6bdfe26645ba6c8087.zip
Merge remote-tracking branch 'origin/released'
Conflicts: openssl/Makefile
Diffstat (limited to 'openssl/crypto/bio/b_print.c')
-rw-r--r--openssl/crypto/bio/b_print.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/openssl/crypto/bio/b_print.c b/openssl/crypto/bio/b_print.c
index 5dc763000..c2cf6e619 100644
--- a/openssl/crypto/bio/b_print.c
+++ b/openssl/crypto/bio/b_print.c
@@ -592,7 +592,6 @@ fmtfp(char **sbuffer,
int fplace = 0;
int padlen = 0;
int zpadlen = 0;
- int caps = 0;
long intpart;
long fracpart;
long max10;
@@ -630,8 +629,7 @@ fmtfp(char **sbuffer,
/* convert integer part */
do {
- iconvert[iplace++] =
- (caps ? "0123456789ABCDEF" : "0123456789abcdef")[intpart % 10];
+ iconvert[iplace++] = "0123456789"[intpart % 10];
intpart = (intpart / 10);
} while (intpart && (iplace < (int)sizeof(iconvert)));
if (iplace == sizeof iconvert)
@@ -640,8 +638,7 @@ fmtfp(char **sbuffer,
/* convert fractional part */
do {
- fconvert[fplace++] =
- (caps ? "0123456789ABCDEF" : "0123456789abcdef")[fracpart % 10];
+ fconvert[fplace++] = "0123456789"[fracpart % 10];
fracpart = (fracpart / 10);
} while (fplace < max);
if (fplace == sizeof fconvert)
@@ -713,6 +710,10 @@ doapr_outch(char **sbuffer,
if (*maxlen == 0)
*maxlen = 1024;
*buffer = OPENSSL_malloc(*maxlen);
+ if(!*buffer) {
+ /* Panic! Can't really do anything sensible. Just return */
+ return;
+ }
if (*currlen > 0) {
assert(*sbuffer != NULL);
memcpy(*buffer, *sbuffer, *currlen);
@@ -721,6 +722,10 @@ doapr_outch(char **sbuffer,
} else {
*maxlen += 1024;
*buffer = OPENSSL_realloc(*buffer, *maxlen);
+ if(!*buffer) {
+ /* Panic! Can't really do anything sensible. Just return */
+ return;
+ }
}
}
/* What to do if *buffer is NULL? */