mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-03-11 17:13:56 -03:00
AP_HAL_PX4: fix possible overflow/truncation issue
bus_id is declared to be a 5 bit value, so 2 digits are necessary for string representation.
This commit is contained in:
parent
5af02dde59
commit
8b8a99e1aa
@ -36,7 +36,7 @@ void *DeviceBus::bus_thread(void *arg)
|
||||
struct DeviceBus *binfo = (struct DeviceBus *)arg;
|
||||
|
||||
// setup a name for the thread
|
||||
char name[] = "XXX:X";
|
||||
char name[] = "XXX:XX";
|
||||
switch (binfo->hal_device->bus_type()) {
|
||||
case AP_HAL::Device::BUS_TYPE_I2C:
|
||||
snprintf(name, sizeof(name), "I2C:%u",
|
||||
|
@ -34,8 +34,8 @@ private:
|
||||
static pthread_mutex_t instance_lock;
|
||||
bool init_done;
|
||||
bool init_ok;
|
||||
char devname[10];
|
||||
char devpath[14];
|
||||
char devname[11];
|
||||
char devpath[15];
|
||||
};
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user