mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-20 21:33:47 -07:00
Make BigBuf take dynamically the available space with a fixed (4K) stack
This commit is contained in:
parent
cb614f3f11
commit
c89fc81fcf
4 changed files with 35 additions and 16 deletions
|
@ -1659,12 +1659,12 @@ static void PacketReceived(PacketCommandNG *packet) {
|
|||
}
|
||||
|
||||
// offset should not be over buffer
|
||||
if (payload->offset >= BIGBUF_SIZE) {
|
||||
if (payload->offset >= BigBuf_get_size()) {
|
||||
reply_ng(CMD_LF_UPLOAD_SIM_SAMPLES, PM3_EOVFLOW, NULL, 0);
|
||||
break;
|
||||
}
|
||||
// ensure len bytes copied wont go past end of bigbuf
|
||||
uint16_t len = MIN(BIGBUF_SIZE - payload->offset, sizeof(payload->data));
|
||||
uint16_t len = MIN(BigBuf_get_size() - payload->offset, sizeof(payload->data));
|
||||
|
||||
uint8_t *mem = BigBuf_get_addr();
|
||||
|
||||
|
@ -2054,7 +2054,7 @@ static void PacketReceived(PacketCommandNG *packet) {
|
|||
void __attribute__((noreturn)) AppMain(void) {
|
||||
|
||||
SpinDelay(100);
|
||||
clear_trace();
|
||||
BigBuf_initialize();
|
||||
|
||||
if (common_area.magic != COMMON_AREA_MAGIC || common_area.version != 1) {
|
||||
/* Initialize common area */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue