Skip to content

memory overwrite in samd21_host.c #271

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
alanambrose opened this issue Oct 20, 2017 · 2 comments
Closed

memory overwrite in samd21_host.c #271

alanambrose opened this issue Oct 20, 2017 · 2 comments

Comments

@alanambrose
Copy link

alanambrose commented Oct 20, 2017

I believe this fix is needed in UHD_Init. I tracked down an overwrite in some memory I had allocated which was being stamped on by the loop below with the uint32 cast (because sizeof() returns # bytes and the uint32 casting counts up in 32-bit words). The replacement memset works fine.:

// ACA - memory overwrite!!
memset(usb_pipe_table,0,sizeof(usb_pipe_table));
/*
for (i = 0; i < sizeof(usb_pipe_table); i++)
{
	(*(uint32_t *)(&usb_pipe_table[0] + i)) = 0;
}
*/
@sandeepmistry
Copy link
Contributor

Hi @alanambrose,

The suggestion looks good to me, would you like to submit a pull request for it?

gdsports pushed a commit to gdsports/ArduinoCore-samd that referenced this issue Sep 2, 2018
cmaglie pushed a commit that referenced this issue Oct 23, 2018
@sandeepmistry sandeepmistry added this to the Release 1.6.20 milestone Oct 23, 2018
@sandeepmistry
Copy link
Contributor

Closed via #355.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants