mirror of
http://thekelleys.org.uk/git/dnsmasq.git
synced 2026-11-15 19:13:49 +00:00
Allow control characters in names in the cache, handle when logging.
This commit is contained in:
1 parent
1e153945de
commit
394ff492da
3 files changed
+37
-23
No files matched your search
+3
-4
@@ -16,7 +16,6 @@
|
||||
|
||||
#include "dnsmasq.h"
|
||||
|
||||
/* isExtract == 2 -> DNSSEC mode, no bitstrings, no ascii checks. */
|
||||
int extract_name(struct dns_header *header, size_t plen, unsigned char **pp,
|
||||
char *name, int isExtract, int extrabytes)
|
||||
{
|
||||
@@ -87,7 +86,7 @@ int extract_name(struct dns_header *header, size_t plen, unsigned char **pp,
|
||||
if ((l & 0x3f) != 1)
|
||||
return 0; /* we only understand bitstrings */
|
||||
|
||||
if (isExtract != 1)
|
||||
if (!isExtract)
|
||||
return 0; /* Cannot compare bitsrings */
|
||||
|
||||
count = *p++;
|
||||
@@ -129,8 +128,8 @@ int extract_name(struct dns_header *header, size_t plen, unsigned char **pp,
|
||||
if (isExtract)
|
||||
{
|
||||
unsigned char c = *p;
|
||||
if ((isExtract == 2 || (isascii(c) && !iscntrl(c))) && c != '.')
|
||||
*cp++ = *p;
|
||||
if (c != 0 && c != '.')
|
||||
*cp++ = c;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user