]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Fixup const void cast warning.
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Mon, 17 Oct 2016 15:17:15 +0000 (15:17 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Mon, 17 Oct 2016 15:17:15 +0000 (15:17 +0000)
git-svn-id: file:///svn/unbound/trunk@3884 be551aaa-1e26-0410-a405-d3ace91eadb9

smallapp/unbound-anchor.c

index c41ec90beb2a3053568dd456fdc28f671f70b71b..68ff3ccc7b22988d3d21ca5b3a74b699e66875da 100644 (file)
@@ -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;
 }