Skip to content

Commit

Permalink
[FS] potential fix for heap poisoning.
Browse files Browse the repository at this point in the history
  • Loading branch information
tschak909 committed Aug 13, 2023
1 parent 6f72c91 commit b45cf05
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/network-protocol/FS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ bool NetworkProtocolFS::read(unsigned short len)

bool NetworkProtocolFS::read_file(unsigned short len)
{
uint8_t *buf = (uint8_t *)malloc(len);
buf = (uint8_t *)malloc(len);

Debug_printf("NetworkProtocolFS::read_file(%u)\r\n", len);

Expand Down
5 changes: 5 additions & 0 deletions lib/network-protocol/FS.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ class NetworkProtocolFS : public NetworkProtocol
*/
bool rmdir_implemented = false;

/**
* Internal temporary buffer for read
*/
uint8_t *buf;

/**
* @brief ctor
* @param rx_buf pointer to receive buffer
Expand Down

0 comments on commit b45cf05

Please sign in to comment.