mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-10-05 05:39:22 +00:00
Check the argument count before indexing config comment log args
A '# do:log.add_output=debug' line read args[1] past the end of the vector.
This commit is contained in:
+6
-2
@@ -86,9 +86,13 @@ config_comment_log(const std::string& command, const std::string& raw_args) {
|
||||
pos = next_pos + 1;
|
||||
}
|
||||
|
||||
if (command == "log.add_output")
|
||||
if (command == "log.add_output") {
|
||||
if (args.size() != 2)
|
||||
throw torrent::input_error("Invalid number of arguments.");
|
||||
|
||||
log_add_group_output_str(args[0], args[1]);
|
||||
else if (command == "log.open_file")
|
||||
|
||||
} else if (command == "log.open_file")
|
||||
apply_log_open_str(0, args);
|
||||
else if (command == "log.open_file.flush")
|
||||
apply_log_open_str(log_flag_flush, args);
|
||||
|
||||
Reference in New Issue
Block a user