Skip to content

Commit

Permalink
Merge pull request #1937 from silvergasp/fix_wrong_size
Browse files Browse the repository at this point in the history
fix: Fix wrong destsz used with tu_memcpy_s
  • Loading branch information
HiFiPhile committed Mar 6, 2023
2 parents 34798ff + 95cfa37 commit a83cef5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/class/audio/audio_device.c
Expand Up @@ -2290,7 +2290,7 @@ bool tud_audio_buffer_and_schedule_control_xfer(uint8_t rhport, tusb_control_req
if (len > _audiod_fct[func_id].ctrl_buf_sz) len = _audiod_fct[func_id].ctrl_buf_sz;

// Copy into buffer
TU_VERIFY(0 == tu_memcpy_s(_audiod_fct[func_id].ctrl_buf, sizeof(_audiod_fct[func_id].ctrl_buf), data, (size_t)len));
TU_VERIFY(0 == tu_memcpy_s(_audiod_fct[func_id].ctrl_buf, _audiod_fct[func_id].ctrl_buf_sz, data, (size_t)len));

// Schedule transmit
return tud_control_xfer(rhport, p_request, (void*)_audiod_fct[func_id].ctrl_buf, len);
Expand Down

0 comments on commit a83cef5

Please sign in to comment.