Skip to content

Commit a83cef5

Browse files
authored
Merge pull request hathach#1937 from silvergasp/fix_wrong_size
fix: Fix wrong destsz used with tu_memcpy_s
2 parents 34798ff + 95cfa37 commit a83cef5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/class/audio/audio_device.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2290,7 +2290,7 @@ bool tud_audio_buffer_and_schedule_control_xfer(uint8_t rhport, tusb_control_req
22902290
if (len > _audiod_fct[func_id].ctrl_buf_sz) len = _audiod_fct[func_id].ctrl_buf_sz;
22912291

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

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

0 commit comments

Comments
 (0)