You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But this changes the type of the dataPoints32 global variable from an array to a pointer. When taking the address and casting to a uint16_t* here this causes a problem.
uint16_t*dataPoints= (uint16_t*)&dataPoints32;
Rather than taking the address of an array, this takes the address of a pointer. Instead of the intended cast from uint32_t* to uint16_t*, it is casting from a uint32_t** to a uint16_t*
Therefore, the dataPoints pointer does not point to the DMA buffer, and the attempts to use it lead to accessing random global variables.
Also, the maxSamples variable in the uploaded code is set to 64, which should be 128 bytes for the dataPoints32 buffer, but the precompiled binary available in this repo does not match this, instead containing a 4096 byte buffer.
The text was updated successfully, but these errors were encountered:
From looking at the uploaded source, I see the oscilloscope binary has some changes to introduce canaries around DMA buffers.
One such case being here where the buffer is defined as:
While the original code defines the array as:
But this changes the type of the dataPoints32 global variable from an array to a pointer. When taking the address and casting to a uint16_t* here this causes a problem.
Rather than taking the address of an array, this takes the address of a pointer. Instead of the intended cast from uint32_t* to uint16_t*, it is casting from a uint32_t** to a uint16_t*
Therefore, the dataPoints pointer does not point to the DMA buffer, and the attempts to use it lead to accessing random global variables.
Also, the maxSamples variable in the uploaded code is set to 64, which should be 128 bytes for the dataPoints32 buffer, but the precompiled binary available in this repo does not match this, instead containing a 4096 byte buffer.
The text was updated successfully, but these errors were encountered: