[Bug Fix] Add Validation to #find, #set, and #show args (#3598)

# Notes
- We were not validating `sep->arg[i]` so we could possibly be pushing a `nullptr` in.
This commit is contained in:
Alex King 2023-09-17 22:20:27 -04:00 committed by GitHub
parent df1d740ae6
commit 26e72c6857
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 3 deletions

View File

@ -72,7 +72,9 @@ void command_find(Client *c, const Seperator *sep)
// skip the first arg
for (auto i = 1; i <= arguments; i++) {
args.emplace_back(sep->arg[i]);
if (sep->arg[i]) {
args.emplace_back(sep->arg[i]);
}
}
// build the rewrite string

View File

@ -136,7 +136,9 @@ void command_set(Client *c, const Seperator *sep)
// skip the first arg
for (auto i = 1; i <= arguments; i++) {
args.emplace_back(sep->arg[i]);
if (sep->arg[i]) {
args.emplace_back(sep->arg[i]);
}
}
// build the rewrite string

View File

@ -115,7 +115,9 @@ void command_show(Client *c, const Seperator *sep)
// skip the first arg
for (auto i = 1; i <= arguments; i++) {
args.emplace_back(sep->arg[i]);
if (sep->arg[i]) {
args.emplace_back(sep->arg[i]);
}
}
// build the rewrite string