mirror of
https://github.com/espressif/esp-lwip.git
synced 2026-10-05 23:37:37 +00:00
api_msg: Fix unused local variable if LWIP_NETCONN_SEM_PER_THREAD=1
Closes CID 460613: Uninitialized pointer read in api_lib.c, netconn_gethostbyname_addrtype
This commit is contained in:
committed by
David Čermák
parent
4297782bf9
commit
aa4f6e780f
+4
-2
@@ -1278,9 +1278,9 @@ netconn_gethostbyname(const char *name, ip_addr_t *addr)
|
|||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
API_VAR_DECLARE(struct dns_api_msg, msg);
|
API_VAR_DECLARE(struct dns_api_msg, msg);
|
||||||
#if !LWIP_MPU_COMPATIBLE
|
#if !LWIP_MPU_COMPATIBLE && !LWIP_NETCONN_SEM_PER_THREAD
|
||||||
sys_sem_t sem;
|
sys_sem_t sem;
|
||||||
#endif /* LWIP_MPU_COMPATIBLE */
|
#endif /* !LWIP_MPU_COMPATIBLE && !LWIP_NETCONN_SEM_PER_THREAD */
|
||||||
err_t err;
|
err_t err;
|
||||||
err_t cberr;
|
err_t cberr;
|
||||||
|
|
||||||
@@ -1308,7 +1308,9 @@ netconn_gethostbyname(const char *name, ip_addr_t *addr)
|
|||||||
API_VAR_REF(msg).name[DNS_MAX_NAME_LENGTH - 1] = 0;
|
API_VAR_REF(msg).name[DNS_MAX_NAME_LENGTH - 1] = 0;
|
||||||
#else /* LWIP_MPU_COMPATIBLE */
|
#else /* LWIP_MPU_COMPATIBLE */
|
||||||
msg.err = &err;
|
msg.err = &err;
|
||||||
|
#if !LWIP_NETCONN_SEM_PER_THREAD
|
||||||
msg.sem = &sem;
|
msg.sem = &sem;
|
||||||
|
#endif
|
||||||
API_VAR_REF(msg).addr = API_VAR_REF(addr);
|
API_VAR_REF(msg).addr = API_VAR_REF(addr);
|
||||||
API_VAR_REF(msg).name = name;
|
API_VAR_REF(msg).name = name;
|
||||||
#endif /* LWIP_MPU_COMPATIBLE */
|
#endif /* LWIP_MPU_COMPATIBLE */
|
||||||
|
|||||||
Reference in New Issue
Block a user