Hello,

When testing dnsproxy of connman, I noticed when sending a cached response, 
that the TTL field and CLASS field might be incorrect.

When looking into this, I found that the TTL value might be written one or two 
characters earlier in the DNS answer.

When looking in the send_cached_response() response routine, I saw 
update_cached_ttl() is called,
which uses dns_name_length to shift the pointer for the name of DNS Question 
and the name of DNS answer. When looking in dns_name_length, I see that strlen 
is used to determine the length of the name. However, strlen is excluding the 
terminating null character '\0', so 1 should be added to strlen for the length 
of the name.
dns_name_length is also used in reply_query_type, here 1 is added to 
dns_name_length.

Therefore, I propose the included patch in dnsproxy.c:

Frank Stevers (1):
  dns_name_length incorrectly returns the length

 src/dnsproxy.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

-- 
2.1.4

_______________________________________________
connman mailing list
connman@connman.net
https://lists.connman.net/mailman/listinfo/connman

Reply via email to