Skip to content

Commit

Permalink
Merge pull request #17 from piernov/fix/buffer-overflow
Browse files Browse the repository at this point in the history
io.c: fix possible buffer overflow in find_all_devices_ccc()
  • Loading branch information
ISpillMyDrink authored Jul 25, 2024
2 parents 3e40e68 + b851c2d commit f39e04a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/opensuperclone/io.c
Original file line number Diff line number Diff line change
Expand Up @@ -6258,7 +6258,7 @@ int find_all_devices_ccc(void)
sscanf(line, "%s %s %s %[^\n]", name, raw_size, raw_bytes_per_sec, model);
strcpy(drive_list_ccc[device_count_ccc], "/dev/");
strcat(drive_list_ccc[device_count_ccc], name);
strncpy(model_ccc[device_count_ccc], model, sizeof(model_ccc));
strncpy(model_ccc[device_count_ccc], model, sizeof(model_ccc[device_count_ccc]) - 1);
// get device info
long long size = strtoull(raw_size, NULL, 0);
long long bytes_per_sec = strtoull(raw_bytes_per_sec, NULL, 0);
Expand Down

0 comments on commit f39e04a

Please sign in to comment.