mirror of
https://github.com/pi-hole/dnsmasq.git
synced 2025-12-19 18:28:25 +00:00
Fix a bug in extract_name_no_compression.
When the maxlen was exactly equal to the length of the string, the function was returning 0 because the end-of-buffer check was misplaced.
This commit is contained in:
committed by
Simon Kelley
parent
32f82c62c8
commit
79333a2498
@@ -48,10 +48,10 @@ static int extract_name_no_compression(unsigned char *rr, int maxlen, char *buf)
|
||||
// Remove trailing dot (if any)
|
||||
if (rr != start)
|
||||
*(--buf) = 0;
|
||||
rr++;
|
||||
if (rr == end)
|
||||
return 0;
|
||||
return rr-start;
|
||||
// Trailing \0 in source data must be consumed
|
||||
return rr-start+1;
|
||||
}
|
||||
|
||||
/* Check whether today/now is between date_start and date_end */
|
||||
|
||||
Reference in New Issue
Block a user