Skip to content

Commit 8e8174a

Browse files
authored
Merge pull request #4274 from kjbracey-arm/dns_query_garbage
NSAPI - Don't send trailing garbage in DNS queries
2 parents 6a96481 + 984e87d commit 8e8174a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

features/netsocket/nsapi_dns.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ static nsapi_size_or_error_t nsapi_dns_query_multiple(NetworkStack *stack, const
227227
uint8_t *question = packet;
228228
dns_append_question(&question, host, version);
229229

230-
err = socket.sendto(SocketAddress(dns_servers[i], 53), packet, DNS_BUFFER_SIZE);
230+
err = socket.sendto(SocketAddress(dns_servers[i], 53), packet, question - packet);
231231
// send may fail for various reasons, including wrong address type - move on
232232
if (err < 0) {
233233
continue;

0 commit comments

Comments
 (0)