aboutsummaryrefslogtreecommitdiff
path: root/pow/POW-0.7/POW.c
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2009-08-25 01:00:51 +0000
committerRob Austein <sra@hactrn.net>2009-08-25 01:00:51 +0000
commit55842c3a643f3b2d00f01e1185372f315cb6371e (patch)
treef99196fb1cb78c3c63886b18695d556f4328336a /pow/POW-0.7/POW.c
parent4199096491a1825fd0b6a2a56bbf4f37a8ba5794 (diff)
Doh, have to null terminate when storing string indefinitely as C
string (rather than immediately converting to Python). svn path=/pow/POW-0.7/POW.c; revision=2708
Diffstat (limited to 'pow/POW-0.7/POW.c')
-rw-r--r--pow/POW-0.7/POW.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/pow/POW-0.7/POW.c b/pow/POW-0.7/POW.c
index 6b45398b..fdf3d13e 100644
--- a/pow/POW-0.7/POW.c
+++ b/pow/POW-0.7/POW.c
@@ -4806,16 +4806,15 @@ static int ssl_object_verify_callback(X509_STORE_CTX *ctx, void *arg)
if (ctx->current_cert)
X509_print(b, ctx->current_cert);
-#if 0
/* This seems to be returning garbage, don't know why */
if (ctx->current_issuer)
X509_print(b, ctx->current_issuer);
-#endif
- if ((len = BIO_ctrl_pending(b)) == 0 || (buf = malloc(len)) == NULL)
+ if ((len = BIO_ctrl_pending(b)) == 0 || (buf = malloc(len + 1)) == NULL)
goto fail;
if (BIO_read(b, buf, len) == len)
+ buf[len] = '\0';
self->x509_cb_err = buf;
else
free(buf);