diff options
Diffstat (limited to 'ares/ares_expand_name.c')
-rw-r--r-- | ares/ares_expand_name.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/ares/ares_expand_name.c b/ares/ares_expand_name.c index 8a9d82215..b0af474df 100644 --- a/ares/ares_expand_name.c +++ b/ares/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; +} |