summaryrefslogtreecommitdiff
path: root/src/resolve/resolved-bus.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2016-01-22 12:04:36 +0100
committerLennart Poettering <lennart@poettering.net>2016-01-25 17:19:19 +0100
commit3347dd5ea1dba5e27a677954b505bb6a2ee6cd75 (patch)
tree792ec6308b0d967b74272be4d7f7634b5c3f911a /src/resolve/resolved-bus.c
parent3731ad2703192dc904922443876d9b2ccff10f5e (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/resolve/resolved-bus.c')
-rw-r--r--src/resolve/resolved-bus.c2
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) {