From 5f58ced71efe398c8c920d79fd90f7b446d06b03 Mon Sep 17 00:00:00 2001 From: "W.C.A. Wijngaards" Date: Tue, 21 Jan 2025 12:30:30 +0100 Subject: [PATCH] - Fix to check length in ATMA string to wire. --- doc/Changelog | 1 + sldns/str2wire.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/doc/Changelog b/doc/Changelog index ad603e3b8..40e739fe7 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -7,6 +7,7 @@ - Fix compile of interface check code when dnscrypt or quic is disabled. - Fix encoding of RR type ATMA. + - Fix to check length in ATMA string to wire. 20 January 2025: Yorgos - Merge #1222: Unique DoT and DoH SSL contexts to allow for different diff --git a/sldns/str2wire.c b/sldns/str2wire.c index 1a956c2b9..b3f5e9798 100644 --- a/sldns/str2wire.c +++ b/sldns/str2wire.c @@ -2559,6 +2559,8 @@ int sldns_str2wire_atma_buf(const char* str, uint8_t* rd, size_t* len) if(slen > LDNS_MAX_RDFLEN*2) return LDNS_WIREPARSE_ERR_LABEL_OVERFLOW; + if(*len < 1) + return LDNS_WIREPARSE_ERR_BUFFER_TOO_SMALL; if(*s == 0) { /* empty string */ rd[0] = 0;