Skip to content
Snippets Groups Projects
Commit 1c2f8bd4 authored by David Sidrane's avatar David Sidrane Committed by Beat Küng
Browse files

board_identity:Fix potential buffer over flow

parent f24a0523
No related branches found
No related tags found
No related merge requests found
......@@ -118,7 +118,7 @@ int board_get_mfguid_formated(char *format_buffer, int size)
board_get_mfguid(mfguid);
int offset = 0;
for (unsigned i = 0; i < PX4_CPU_MFGUID_BYTE_LENGTH; i++) {
for (unsigned i = 0; offset < size && i < PX4_CPU_MFGUID_BYTE_LENGTH; i++) {
offset += snprintf(&format_buffer[offset], size - offset, "%02x", mfguid[i]);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment