]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
Fix for zeroes in data.
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Wed, 29 Sep 2010 16:11:14 +0000 (16:11 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Wed, 29 Sep 2010 16:11:14 +0000 (16:11 +0000)
git-svn-id: file:///svn/unbound/trunk@2266 be551aaa-1e26-0410-a405-d3ace91eadb9

smallapp/unbound-anchor.c

index b6ae4cd5e024974429efeb06296a65e6d7ada643..2a643b0544c0788bcdbed79c49e7403f1aca20c8 100644 (file)
@@ -811,7 +811,7 @@ process_one_header(char* buf, size_t* clen, int* chunked)
 }
 
 /** 
- * Read one file from SSL
+ * Read one line from SSL
  * zero terminates.
  * skips "\r\n" (but not copied to buf).
  * @param ssl: the SSL connection to read from (blocking).
@@ -1018,11 +1018,12 @@ read_http_result(SSL* ssl)
                /* the result is zero terminated for robustness, but we 
                 * do not include that in the BIO len (for binary data) */
                len = (size_t)l-1;
-               data = strdup(d);
+               data = (char*)malloc(l);
                if(data == NULL) {
                        if(verb) printf("out of memory\n");
                        return NULL;
                }
+               memcpy(data, d, l);
                BIO_free(tmp);
        } else {
                data = read_data_chunk(ssl, len);
@@ -1870,7 +1871,7 @@ extern int optind;
 /** getopt global, in case header files fail to declare it. */
 extern char* optarg;
 
-/** Main routine for checkconf */
+/** Main routine for unbound-anchor */
 int main(int argc, char* argv[])
 {
        int c;