diff options
| author | Old-Ding <[email protected]> | 2026-07-06 11:24:34 +0800 |
|---|---|---|
| committer | Rbb666 <[email protected]> | 2026-07-20 09:39:17 +0800 |
| commit | b6cdae57d4e93c31d9ed7c6751ca5ffcdd46493c (patch) | |
| tree | 82629e6ecc3f6a1703f075c5408dfa138bfebdd5 /components | |
| parent | 247f540f6bf5fd182f0426d719f3902bdd885fa5 (diff) | |
net: lwip: fix mDNS test buffer fill size
Fill the mDNS domain name buffers with their array size instead of the size of the MDNS_DOMAIN_MAXLEN constant. This preserves the test intent of leaving different trailing bytes after equal names are encoded.
Generated-by: OpenAI Codex
Signed-off-by: Old-Ding <[email protected]>
Diffstat (limited to 'components')
| -rw-r--r-- | components/net/lwip/lwip-2.0.3/test/unit/mdns/test_mdns.c | 4 | ||||
| -rw-r--r-- | components/net/lwip/lwip-2.1.2/test/unit/mdns/test_mdns.c | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/components/net/lwip/lwip-2.0.3/test/unit/mdns/test_mdns.c b/components/net/lwip/lwip-2.0.3/test/unit/mdns/test_mdns.c index ca9be64ea1..2c09c857d3 100644 --- a/components/net/lwip/lwip-2.0.3/test/unit/mdns/test_mdns.c +++ b/components/net/lwip/lwip-2.0.3/test/unit/mdns/test_mdns.c @@ -572,14 +572,14 @@ START_TEST(domain_eq_length) LWIP_UNUSED_ARG(_i); memset(&domain1, 0, sizeof(domain1)); - memset(domain1.name, 0xAA, sizeof(MDNS_DOMAIN_MAXLEN)); + memset(domain1.name, 0xAA, sizeof(domain1.name)); res = mdns_domain_add_label(&domain1, "multi", 5); fail_unless(res == ERR_OK); res = mdns_domain_add_label(&domain1, "cast", 4); fail_unless(res == ERR_OK); memset(&domain2, 0, sizeof(domain2)); - memset(domain2.name, 0xBB, sizeof(MDNS_DOMAIN_MAXLEN)); + memset(domain2.name, 0xBB, sizeof(domain2.name)); res = mdns_domain_add_label(&domain2, "multi", 5); fail_unless(res == ERR_OK); res = mdns_domain_add_label(&domain2, "cast", 4); diff --git a/components/net/lwip/lwip-2.1.2/test/unit/mdns/test_mdns.c b/components/net/lwip/lwip-2.1.2/test/unit/mdns/test_mdns.c index 638516370a..8d341fb09f 100644 --- a/components/net/lwip/lwip-2.1.2/test/unit/mdns/test_mdns.c +++ b/components/net/lwip/lwip-2.1.2/test/unit/mdns/test_mdns.c @@ -572,14 +572,14 @@ START_TEST(domain_eq_length) LWIP_UNUSED_ARG(_i); memset(&domain1, 0, sizeof(domain1)); - memset(domain1.name, 0xAA, sizeof(MDNS_DOMAIN_MAXLEN)); + memset(domain1.name, 0xAA, sizeof(domain1.name)); res = mdns_domain_add_label(&domain1, "multi", 5); fail_unless(res == ERR_OK); res = mdns_domain_add_label(&domain1, "cast", 4); fail_unless(res == ERR_OK); memset(&domain2, 0, sizeof(domain2)); - memset(domain2.name, 0xBB, sizeof(MDNS_DOMAIN_MAXLEN)); + memset(domain2.name, 0xBB, sizeof(domain2.name)); res = mdns_domain_add_label(&domain2, "multi", 5); fail_unless(res == ERR_OK); res = mdns_domain_add_label(&domain2, "cast", 4); |
