mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2025-02-04 12:39:58 +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;
|
||||
}
|
||||
|
||||
/** @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 */
|
||||
|
@ -86,6 +86,7 @@ struct tftp_context {
|
||||
};
|
||||
|
||||
err_t tftp_init(const struct tftp_context* ctx);
|
||||
void tftp_cleanup(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user