update changelog
[debian/iodine.git] / tests / dns.c
index 55e753b5bf669716cb23bd9cf87f434fb93edb46..3d21e4c1cb6d57372615d940d56a287f09fdc155 100644 (file)
@@ -68,9 +68,10 @@ START_TEST(test_encode_query)
        struct encoder *enc;
        char *d;
        size_t len;
+       size_t enclen;
        int ret;
 
-       len = sizeof(buf);
+       enclen = sizeof(resolv);
        memset(&buf, 0, sizeof(buf));
        memset(&resolv, 0, sizeof(resolv));
        memset(&q, 0, sizeof(struct query));
@@ -80,12 +81,13 @@ START_TEST(test_encode_query)
        enc = get_base32_encoder();
 
        *d++ = 'A';
-       enc->encode(d, &len, innerData, strlen(innerData));
+       enc->encode(d, &enclen, innerData, strlen(innerData));
        d = resolv + strlen(resolv);
        if (*d != '.') {
                *d++ = '.';
        }
        strcpy(d, topdomain);
+       len = sizeof(buf);
        ret = dns_encode(buf, len, &q, QR_QUERY, resolv, strlen(resolv));
        len = sizeof(query_packet) - 1; /* Skip extra null character */