doh: Constify some input pointers

Closes #5306
This commit is contained in:
Rikard Falkeborn 2020-04-27 12:07:34 +02:00 committed by Daniel Stenberg
parent cad15b9f92
commit fc0e29dd57
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
3 changed files with 19 additions and 17 deletions

View file

@ -185,7 +185,7 @@ UNITTEST_START
size_t len;
int u;
memset(&d, 0, sizeof(d));
rc = doh_decode((unsigned char *)resp[i].packet, resp[i].size,
rc = doh_decode((const unsigned char *)resp[i].packet, resp[i].size,
resp[i].type, &d);
if(rc != resp[i].rc) {
fprintf(stderr, "resp %zu: Expected return code %d got %d\n", i,
@ -241,7 +241,7 @@ UNITTEST_START
struct dohentry d;
int rc;
memset(&d, 0, sizeof(d));
rc = doh_decode((unsigned char *)full49, i, DNS_TYPE_A, &d);
rc = doh_decode((const unsigned char *)full49, i, DNS_TYPE_A, &d);
if(!rc) {
/* none of them should work */
fprintf(stderr, "%zu: %d\n", i, rc);
@ -253,7 +253,7 @@ UNITTEST_START
struct dohentry d;
int rc;
memset(&d, 0, sizeof(d));
rc = doh_decode((unsigned char *)&full49[i], sizeof(full49)-i-1,
rc = doh_decode((const unsigned char *)&full49[i], sizeof(full49)-i-1,
DNS_TYPE_A, &d);
if(!rc) {
/* none of them should work */
@ -266,7 +266,7 @@ UNITTEST_START
struct dohentry d;
struct dohaddr *a;
memset(&d, 0, sizeof(d));
rc = doh_decode((unsigned char *)full49, sizeof(full49)-1,
rc = doh_decode((const unsigned char *)full49, sizeof(full49)-1,
DNS_TYPE_A, &d);
fail_if(d.numaddr != 1, "missing address");
a = &d.addr[0];