You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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));'
The text was updated successfully, but these errors were encountered:
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));'
The text was updated successfully, but these errors were encountered: