1
0
mirror of https://frontier.innolan.net/rainlance/c-ares.git synced 2025-12-08 15:44:16 +00:00

In ares_mkquery, make sure we set buflen and buf to reasonable values if there's an error. (Patch from the Google tree)

This commit is contained in:
Steinar H. Gunderson
2007-09-29 13:56:36 +00:00
parent cccd9a58cd
commit 22c2794e76

View File

@ -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;