aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Jonas Gunz <himself@jonasgunz.de> 2021-09-21 17:09:31 +0200
committerGravatar Jonas Gunz <himself@jonasgunz.de> 2021-09-21 17:09:31 +0200
commit08c48ad70641ffff389288dcaaa08aad8851cc1a (patch)
tree97ba6e91c8f423468e3bf0c453b1de72703664de
parent51da994a563fd4746410f3b093fa7acb4fde3a20 (diff)
downloaddns-08c48ad70641ffff389288dcaaa08aad8851cc1a.tar.gz
TODOs
-rw-r--r--src/dns.c2
-rw-r--r--src/record.c8
2 files changed, 8 insertions, 2 deletions
diff --git a/src/dns.c b/src/dns.c
index 4f5b2b6..95baf56 100644
--- a/src/dns.c
+++ b/src/dns.c
@@ -194,6 +194,7 @@ int dns_parse_packet ( char* _buffer, int _bufflen, dns_message_t* _msg )
return 0;
}
+/* TODO Check logic, especially size requirements */
int fqdn_to_qname( char* _source, int _sourcelen, char* _sink, int _sinklen )
{
int i, o;
@@ -257,6 +258,7 @@ int fqdn_check ( char* _source, int _sourcelen ) {
return 0;
}
+/* TODO Check logic, especially size requirements */
int qname_to_fqdn( char* _source, int _sourcelen, char* _sink, int _sinklen )
{
unsigned int next_dot;
diff --git a/src/record.c b/src/record.c
index 22b350f..e323718 100644
--- a/src/record.c
+++ b/src/record.c
@@ -128,7 +128,11 @@ static ssize_t record_rdata_qname(char* _str, void** _rdata) {
return -1;
}
- *_rdata = malloc(qlen);
+ /*
+ * TODO Some funny business is going on around here
+ * Related to fqdn_to_qname()
+ */
+ *_rdata = malloc(qlen+1);
if ( !*_rdata )
return -1;
@@ -215,7 +219,7 @@ uint16_t record_type_from_str(char* _str) {
ssize_t record_rdata_from_str(void** _rdata, char *_str, uint16_t _rdtype) {
uint16_t index;
- if ( _rdtype >= record_types_len )
+ if ( _rdtype > record_types_len )
return -1;
if ( !_rdata || !_str )