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

devices/rhf76_lora/RHF76.c的函数rhf76_incoming_data_process数组处理错误 #80

Closed
DavidLin1577 opened this issue Jan 20, 2020 · 3 comments

Comments

@DavidLin1577
Copy link
Contributor

1.定义__STATIC__ char incoming_data_buffer[128];,数组长度是128,但是在函数内部 memset(incoming_data_buffer, 0x00, 512));,此时清零的长度是512,这会导致内存泄漏
应该修复成memset(incoming_data_buffer, 0x00, 128));,但为了避免类似错误,使用
memset(incoming_data_buffer, 0x00, sizeof(incoming_data_buffer));
2.STATIC char incoming_data_buffer[128]; but in function memset(incoming_data_buffer, 0x00, 512); define is 128, memset is 512.
3. so we fixed this replace with 'sizeof(incoming_data_buffer)', just like this 'memset(incoming_data_buffer, 0x00, sizeof(incoming_data_buffer));'

@daishengdong
Copy link
Collaborator

非常感谢,这里我们马上修复。同时后续模组抽象层接口会进行一些重构,将数据接收buffer作为模组初始化的入参,让用户指定接收的buffer及大小。

@daishengdong
Copy link
Collaborator

实在不好意思,没看到您的PR,我自己提交了修改。

@DavidLin1577
Copy link
Contributor Author

没事^-^

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

2 participants