Skip to content

Commit

Permalink
Revert "Fixed sdps crash for some size flash.bin"
Browse files Browse the repository at this point in the history
This reverts commit de317f5.

The upcoming patch will fix the issue more straight forward.

Signed-off-by: Marco Felsch <[email protected]>
  • Loading branch information
Marco Felsch authored and nxpfrankli committed Nov 16, 2023
1 parent de317f5 commit 26d4b25
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions libuuu/hidreport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,6 @@ int HIDReport::write(const void *p, size_t sz, uint8_t report_id)
m_out_buff[0] = report_id;

size_t s = sz - off;
size_t copy_sz = s;

if (copy_sz > m_size_out)
copy_sz = m_size_out;

/*
* The Windows HIDAPI is ver strict. It always require to send
Expand All @@ -92,8 +88,7 @@ int HIDReport::write(const void *p, size_t sz, uint8_t report_id)
if (s > m_size_out || report_id == 2)
s = m_size_out;

/* copy_sz can't be bigger then input data size, otherwise access unpaged memory */
memcpy(m_out_buff.data() + m_size_payload, buff + off, copy_sz);
memcpy(m_out_buff.data() + m_size_payload, buff + off, s);

int ret = m_pdev->write(m_out_buff.data(), s + m_size_payload);

Expand Down

0 comments on commit 26d4b25

Please sign in to comment.