From: Wouter Wijngaards Date: Mon, 17 Oct 2016 15:17:15 +0000 (+0000) Subject: - Fixup const void cast warning. X-Git-Tag: release-1.6.0rc1~73 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=70dbd1c382f1e34499c3101cb6885fddaba9b419;p=thirdparty%2Funbound.git - Fixup const void cast warning. git-svn-id: file:///svn/unbound/trunk@3884 be551aaa-1e26-0410-a405-d3ace91eadb9 --- diff --git a/smallapp/unbound-anchor.c b/smallapp/unbound-anchor.c index c41ec90be..68ff3ccc7 100644 --- a/smallapp/unbound-anchor.c +++ b/smallapp/unbound-anchor.c @@ -420,8 +420,14 @@ read_builtin_cert(void) { const char* builtin_cert = get_builtin_cert(); STACK_OF(X509)* sk; - BIO *bio = BIO_new_mem_buf((const void*)builtin_cert, - (int)strlen(builtin_cert)); + BIO *bio; + char* d = strdup(builtin_cert); /* to avoid const warnings in the + changed prototype of BIO_new_mem_buf */ + if(!d) { + if(verb) printf("out of memory\n"); + exit(0); + } + bio = BIO_new_mem_buf(d, (int)strlen(d)); if(!bio) { if(verb) printf("out of memory\n"); exit(0); @@ -432,6 +438,7 @@ read_builtin_cert(void) exit(0); } BIO_free(bio); + free(d); return sk; }