mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-03 01:21:35 +08:00
Fix potential string overflow corner case
This commit is contained in:
@@ -452,8 +452,8 @@ calibrate_return calibrate_from_orientation(orb_advert_t *mavlink_log_pub,
|
|||||||
|
|
||||||
for (unsigned int cur_orientation=0; cur_orientation<detect_orientation_side_count; cur_orientation++) {
|
for (unsigned int cur_orientation=0; cur_orientation<detect_orientation_side_count; cur_orientation++) {
|
||||||
if (!side_data_collected[cur_orientation]) {
|
if (!side_data_collected[cur_orientation]) {
|
||||||
strncat(pendingStr, " ", sizeof(pendingStr));
|
strncat(pendingStr, " ", sizeof(pendingStr) - 1);
|
||||||
strncat(pendingStr, detect_orientation_str((enum detect_orientation_return)cur_orientation), sizeof(pendingStr));
|
strncat(pendingStr, detect_orientation_str((enum detect_orientation_return)cur_orientation), sizeof(pendingStr) - 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
calibration_log_info(mavlink_log_pub, "[cal] pending:%s", pendingStr);
|
calibration_log_info(mavlink_log_pub, "[cal] pending:%s", pendingStr);
|
||||||
|
|||||||
Reference in New Issue
Block a user