mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-12-25 18:14:53 +00:00
apps/smtp: Avoid NULL pointer dereference in smtp_send_body_data_handler
Move the code to have NULL test before dereference. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: goldsimon <goldsimon@gmx.de>
This commit is contained in:
parent
df563e74f9
commit
0527c1bdf5
@ -1496,9 +1496,10 @@ smtp_send_mail_bodycback(const char *from, const char* to, const char* subject,
|
|||||||
static void
|
static void
|
||||||
smtp_send_body_data_handler(struct smtp_session *s, struct altcp_pcb *pcb)
|
smtp_send_body_data_handler(struct smtp_session *s, struct altcp_pcb *pcb)
|
||||||
{
|
{
|
||||||
struct smtp_bodydh_state *bdh = s->bodydh;
|
struct smtp_bodydh_state *bdh;
|
||||||
int res = 0, ret;
|
int res = 0, ret;
|
||||||
LWIP_ASSERT("s != NULL", s != NULL);
|
LWIP_ASSERT("s != NULL", s != NULL);
|
||||||
|
bdh = s->bodydh;
|
||||||
LWIP_ASSERT("bodydh != NULL", bdh != NULL);
|
LWIP_ASSERT("bodydh != NULL", bdh != NULL);
|
||||||
|
|
||||||
/* resume any leftovers from prior memory constraints */
|
/* resume any leftovers from prior memory constraints */
|
||||||
|
Loading…
Reference in New Issue
Block a user