summaryrefslogtreecommitdiff
path: root/ares_expand_name.c
diff options
context:
space:
mode:
Diffstat (limited to 'ares_expand_name.c')
-rw-r--r--ares_expand_name.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/ares_expand_name.c b/ares_expand_name.c
index 8a9d822..b0af474 100644
--- a/ares_expand_name.c
+++ b/ares_expand_name.c
@@ -177,3 +177,14 @@ static int name_length(const unsigned char *encoded, const unsigned char *abuf,
*/
return (n) ? n - 1 : n;
}
+
+/* Like ares_expand_name but returns EBADRESP in case of invalid input. */
+int ares__expand_name_for_response(const unsigned char *encoded,
+ const unsigned char *abuf, int alen,
+ char **s, long *enclen)
+{
+ int status = ares_expand_name(encoded, abuf, alen, s, enclen);
+ if (status == ARES_EBADNAME)
+ status = ARES_EBADRESP;
+ return status;
+}