diff options
author | Daniel Stenberg <daniel@haxx.se> | 2018-09-07 09:26:08 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2018-09-07 09:26:08 +0200 |
commit | c515294cec6ee9b72d68e6f13dc1972bcf3fed30 (patch) | |
tree | e65cd8eec00db99aeb8609b95cddf0a78a098c57 | |
parent | 10009222fedec4f664d80ffb508b236fd75da9da (diff) | |
download | curl-c515294cec6ee9b72d68e6f13dc1972bcf3fed30.tar.gz |
doh: minor edits to please Coverity
The gcc typecheck macros and coverity combined made it warn on the 2nd
argument for ERROR_CHECK_SETOPT(). Here's minor rearrange to please it.
Coverity CID 1439115 and CID 1439114.
-rw-r--r-- | lib/doh.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -218,11 +218,14 @@ static CURLcode dohprobe(struct Curl_easy *data, /* Curl_open() is the internal version of curl_easy_init() */ result = Curl_open(&doh); if(!result) { + /* pass in the struct pointer via a local variable to please coverity and + the gcc typecheck helpers */ + struct dohresponse *resp = &p->serverdoh; ERROR_CHECK_SETOPT(CURLOPT_URL, url); ERROR_CHECK_SETOPT(CURLOPT_WRITEFUNCTION, doh_write_cb); - ERROR_CHECK_SETOPT(CURLOPT_WRITEDATA, (void *)&p->serverdoh); + ERROR_CHECK_SETOPT(CURLOPT_WRITEDATA, resp); if(!data->set.doh_get) { - ERROR_CHECK_SETOPT(CURLOPT_POSTFIELDS, &p->dohbuffer[0]); + ERROR_CHECK_SETOPT(CURLOPT_POSTFIELDS, p->dohbuffer); ERROR_CHECK_SETOPT(CURLOPT_POSTFIELDSIZE, p->dohlen); } ERROR_CHECK_SETOPT(CURLOPT_HTTPHEADER, headers); |