diff options
author | Lennart Poettering <lennart@poettering.net> | 2016-01-22 12:04:36 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2016-01-25 17:19:19 +0100 |
commit | 3347dd5ea1dba5e27a677954b505bb6a2ee6cd75 (patch) | |
tree | 792ec6308b0d967b74272be4d7f7634b5c3f911a /src | |
parent | 3731ad2703192dc904922443876d9b2ccff10f5e (diff) |
resolved: fix rcode formatting string length
Since we honour the edns rcode extension we need more than 4 bits to format it. To avoid further confusion, derive the
right length from the type.
Diffstat (limited to 'src')
-rw-r--r-- | src/resolve/resolved-bus.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/resolve/resolved-bus.c b/src/resolve/resolved-bus.c index bc2d6dd2fc..2cb622885f 100644 --- a/src/resolve/resolved-bus.c +++ b/src/resolve/resolved-bus.c @@ -69,7 +69,7 @@ static int reply_query_state(DnsQuery *q) { sd_bus_error_setf(&error, _BUS_ERROR_DNS "NXDOMAIN", "'%s' not found", dns_query_string(q)); else { const char *rc, *n; - char p[3]; /* the rcode is 4 bits long */ + char p[DECIMAL_STR_MAX(q->answer_rcode)]; rc = dns_rcode_to_string(q->answer_rcode); if (!rc) { |