-
Notifications
You must be signed in to change notification settings - Fork 252
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
Bug:OTA相关 #140
Comments
感谢您对反馈 我们已经将您的建议反馈给研发的同学 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
iotkit-embedded/src/services/linkkit/dm/dm_fota.c 这个文件中的66行有一个bug。
file_downloaded及file_size的大小默认是unit32_t类型,这个类型的最大值为4294967295
也就是文件可以最大4个G,这对于固件应该不是问题,但往下看。
percent_now = (file_downloaded * 100) / file_size;
因为这里面乘以100,如果固件大于42M,造成数据溢出。就会造成更新进度异常。
所以只需要改一下
uint32_t file_size = 0, file_downloaded = 0;
为
uint64_t file_size = 0, file_downloaded = 0;
The text was updated successfully, but these errors were encountered: