Guard for block device name string starting with "/dev/"
This commit is contained in:
parent
cf85ca788a
commit
88a1a87ca6
1 changed files with 5 additions and 0 deletions
|
|
@ -194,6 +194,11 @@ int main(int argc, char *argv[]) {
|
|||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
if (0 != strncmp(wjob.dev_name, "/dev/", 4)) {
|
||||
printf("\"%s\" does not appear to be a block device...\n", wjob.dev_name);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
printf("Writing %s to %s\n", wjob.filename, wjob.dev_name);
|
||||
|
||||
wjob.buffer = malloc(BLOCKSIZE);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue