mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-09-17 20:24:24 +00:00
Apply (modified) patch #9552: tftp_cleanup() for cleanup and filename buffer zeroing to prevent filename bugs
... without the memset to zero out the filename
This commit is contained in:
parent
83ff2014ae
commit
40997c4a08
@ -412,4 +412,14 @@ tftp_init(const struct tftp_context *ctx)
|
|||||||
return ERR_OK;
|
return ERR_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @ingroup tftp
|
||||||
|
* Deinitialize ("turn off") TFTP server.
|
||||||
|
*/
|
||||||
|
void tftp_cleanup(void)
|
||||||
|
{
|
||||||
|
LWIP_ASSERT("Cleanup called on non-initialized TFTP", tftp_state.upcb != NULL);
|
||||||
|
udp_remove(tftp_state.upcb);
|
||||||
|
memset(&tftp_state, 0, sizeof(tftp_state));
|
||||||
|
}
|
||||||
|
|
||||||
#endif /* LWIP_UDP */
|
#endif /* LWIP_UDP */
|
||||||
|
@ -86,6 +86,7 @@ struct tftp_context {
|
|||||||
};
|
};
|
||||||
|
|
||||||
err_t tftp_init(const struct tftp_context* ctx);
|
err_t tftp_init(const struct tftp_context* ctx);
|
||||||
|
void tftp_cleanup(void);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user