mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-09 18:45:54 +02:00
misc-progs: smartctrl: Sanitise device name
Fixes: #12562 Reported-by: Albert Schwarzkopf <ipfire@quitesimple.org> Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
This commit is contained in:
@@ -22,6 +22,11 @@ int main(int argc, char *argv[]) {
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (!is_valid_argument_alnum(argv[1])) {
|
||||
fprintf(stderr, "Invalid device name '%s'\n", argv[1]);
|
||||
exit(2);
|
||||
}
|
||||
|
||||
char command[STRING_SIZE];
|
||||
snprintf(command, STRING_SIZE, "/var/run/hddshutdown-%s", argv[1]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user