badwords: catch and fix more variants of NN-bit

Closes #20304
This commit is contained in:
Viktor Szakats 2026-01-11 14:50:27 +01:00
parent 60ab58a8a5
commit 4651d4c76b
No known key found for this signature in database
GPG key ID: B5ABD165E2AEF201
20 changed files with 29 additions and 32 deletions

View file

@ -113,7 +113,7 @@ UNITTEST DOHcode doh_req_encode(const char *host,
if(len < expected_len)
return DOH_TOO_SMALL_BUFFER;
*dnsp++ = 0; /* 16 bit id */
*dnsp++ = 0; /* 16-bit id */
*dnsp++ = 0;
*dnsp++ = 0x01; /* |QR| Opcode |AA|TC|RD| Set the RD bit */
*dnsp++ = '\0'; /* |RA| Z | RCODE | */
@ -152,10 +152,10 @@ UNITTEST DOHcode doh_req_encode(const char *host,
*dnsp++ = 0; /* append zero-length label for root */
/* There are assigned TYPE codes beyond 255: use range [1..65535] */
*dnsp++ = (unsigned char)(255 & (dnstype >> 8)); /* upper 8 bit TYPE */
*dnsp++ = (unsigned char)(255 & dnstype); /* lower 8 bit TYPE */
*dnsp++ = (unsigned char)(255 & (dnstype >> 8)); /* upper 8-bit TYPE */
*dnsp++ = (unsigned char)(255 & dnstype); /* lower 8-bit TYPE */
*dnsp++ = '\0'; /* upper 8 bit CLASS */
*dnsp++ = '\0'; /* upper 8-bit CLASS */
*dnsp++ = DNS_CLASS_IN; /* IN - "the Internet" */
*olen = dnsp - orig;