Skip to content
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

useless copying and danger of buffer overflow #8

Open
nichtgedacht opened this issue Aug 26, 2016 · 0 comments
Open

useless copying and danger of buffer overflow #8

nichtgedacht opened this issue Aug 26, 2016 · 0 comments

Comments

@nichtgedacht
Copy link

uint8_t CDC_Transmit_FS(uint8_t* Buf, uint16_t Len)
{
uint8_t result = USBD_OK;
/* USER CODE BEGIN 8 */
uint16_t i;

for (i=0; i < sizeof(UserTxBufferFS); i++) {
UserTxBufferFS[i] = 0;
}

for (i=0; i < Len; i++) {
UserTxBufferFS[i] = Buf[i];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant