diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2021-08-12 09:19:14 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2021-08-12 09:19:14 +0000 |
commit | ecc5838aff97659dd679f03edc8838205f868848 (patch) | |
tree | 85848124743d10e50adce2e36e3566b3d37b4ce7 /src/dns.c | |
parent | Adding upstream version 2.6.0. (diff) | |
download | dnsperf-ecc5838aff97659dd679f03edc8838205f868848.tar.xz dnsperf-ecc5838aff97659dd679f03edc8838205f868848.zip |
Adding upstream version 2.7.0.upstream/2.7.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | src/dns.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -53,6 +53,7 @@ const char* perf_dns_rcode_strings[] = { perf_result_t perf_dname_fromstring(const char* str, size_t len, perf_buffer_t* target) { size_t label_len, at; + ssize_t max = 255; const char* orig_str = str; bool is_quoted; @@ -101,6 +102,10 @@ perf_result_t perf_dname_fromstring(const char* str, size_t len, perf_buffer_t* if (label_len > 63) { return PERF_R_FAILURE; } + max -= label_len + 1; + if (max < 0) { + return PERF_R_FAILURE; + } perf_buffer_putuint8(target, label_len); if (is_quoted) { for (at = 0; at < len; at++) { |