always make sure resp is initialized

This commit is contained in:
iceman1001 committed 2023-08-02 17:36:50 +02:00
1 parent 0388682591
commit 4ee7b78a07
1 file changed
+3 -1
+3 -1
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();