Skip to content

Commit

Permalink
bdmsupport.c: fix overflow
Browse files Browse the repository at this point in the history
  • Loading branch information
KrahJohlito committed Sep 5, 2024
1 parent 3617948 commit e7cf5d9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/bdmsupport.c
Original file line number Diff line number Diff line change
Expand Up @@ -582,14 +582,14 @@ static void bdmCleanUp(item_list_t *itemList, int exception)
// This may be called, even if bdmInit() was not.
static void bdmShutdown(item_list_t *itemList)
{
char path[10] = {0};
char path[16];

LOG("BDMSUPPORT Shutdown\n");

// Format the device path.
// Getting the device number is only relevant per module ie usb0 and mx40 will result in both being massDeviceIndex = 0 or mass0, use mode to determine instead.
bdm_device_data_t *pDeviceData = (bdm_device_data_t *)itemList->priv;
sprintf(path, "mass%d:", itemList->mode);
snprintf(path, sizeof(path), "mass%d:", itemList->mode);

// As required by some (typically 2.5") HDDs, issue the SCSI STOP UNIT command to avoid causing an emergency park.
fileXioDevctl(path, USBMASS_DEVCTL_STOP_ALL, NULL, 0, NULL, 0);
Expand Down

0 comments on commit e7cf5d9

Please sign in to comment.