always make sure resp is initialized

This commit is contained in:
iceman1001 2023-08-02 17:36:50 +02:00
parent 0388682591
commit 4ee7b78a07

View file

@ -820,7 +820,6 @@ bool WaitForResponse(uint32_t cmd, PacketResponseNG *response) {
bool GetFromDevice(DeviceMemType_t memtype, uint8_t *dest, uint32_t bytes, uint32_t start_index, uint8_t *data, uint32_t datalen, PacketResponseNG *response, size_t ms_timeout, bool show_warning) {
if (dest == NULL) return false;
if (bytes == 0) return true;
PacketResponseNG resp;
if (response == NULL) {
@ -839,6 +838,9 @@ bool GetFromDevice(DeviceMemType_t memtype, uint8_t *dest, uint32_t bytes, uint3
resp.oldarg[2] = 0;
memset(resp.data.asBytes, 0, PM3_CMD_DATA_SIZE);
if (bytes == 0) return true;
// clear
clearCommandBuffer();