Skip to content

Commit

Permalink
Merge pull request #744 from andrew-lifx/fix/mdns_append_fqdn
Browse files Browse the repository at this point in the history
fix(mdns): Fix _mdns_append_fqdn excessive stack usage (IDFGH-14506)
  • Loading branch information
david-cermak authored Jan 28, 2025
2 parents d4a004b + bd23c23 commit 2e7d240
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion components/mdns/mdns.c
Original file line number Diff line number Diff line change
Expand Up @@ -751,12 +751,12 @@ static uint16_t _mdns_append_fqdn(uint8_t *packet, uint16_t *index, const char *
//empty string so terminate
return _mdns_append_u8(packet, index, 0);
}
mdns_name_t name;
static char buf[MDNS_NAME_BUF_LEN];
uint8_t len = strlen(strings[0]);
//try to find first the string length in the packet (if it exists)
uint8_t *len_location = (uint8_t *)memchr(packet, (char)len, *index);
while (len_location) {
mdns_name_t name;
//check if the string after len_location is the string that we are looking for
if (memcmp(len_location + 1, strings[0], len)) { //not continuing with our string
search_next:
Expand Down

0 comments on commit 2e7d240

Please sign in to comment.