projects
/
platform
/
upstream
/
systemd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3731ad2
)
resolved: fix rcode formatting string length
author
Lennart Poettering
<lennart@poettering.net>
Fri, 22 Jan 2016 11:04:36 +0000
(12:04 +0100)
committer
Lennart Poettering
<lennart@poettering.net>
Mon, 25 Jan 2016 16:19:19 +0000
(17:19 +0100)
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.
src/resolve/resolved-bus.c
patch
|
blob
|
history
diff --git
a/src/resolve/resolved-bus.c
b/src/resolve/resolved-bus.c
index
bc2d6dd
..
2cb6228
100644
(file)
--- 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) {