diff options
author | Jonas Gunz <himself@jonasgunz.de> | 2021-09-21 17:09:31 +0200 |
---|---|---|
committer | Jonas Gunz <himself@jonasgunz.de> | 2021-09-21 17:09:31 +0200 |
commit | 08c48ad70641ffff389288dcaaa08aad8851cc1a (patch) | |
tree | 97ba6e91c8f423468e3bf0c453b1de72703664de | |
parent | 51da994a563fd4746410f3b093fa7acb4fde3a20 (diff) | |
download | dns-08c48ad70641ffff389288dcaaa08aad8851cc1a.tar.gz |
TODOs
-rw-r--r-- | src/dns.c | 2 | ||||
-rw-r--r-- | src/record.c | 8 |
2 files changed, 8 insertions, 2 deletions
@@ -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 ) |