Skip to content
Snippets Groups Projects
Commit d6dd8485 authored by Steinar H. Gunderson's avatar Steinar H. Gunderson
Browse files

In ares_mkquery, make sure we set buflen and buf to reasonable values if...

In ares_mkquery, make sure we set buflen and buf to reasonable values if there's an error. (Patch from the Google tree)
parent 9fc66e4d
No related branches found
No related tags found
No related merge requests found
......@@ -88,6 +88,10 @@ int ares_mkquery(const char *name, int dnsclass, int type, unsigned short id,
unsigned char *q;
const char *p;
/* Set our results early, in case we bail out early with an error. */
*buflen = 0;
*buf = NULL;
/* Compute the length of the encoded name so we can check buflen.
* Start counting at 1 for the zero-length label at the end. */
len = 1;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment