[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 authored and GitHub committed 2023-09-17 21:20:27 -05:00
1 parent df1d740ae6
commit 26e72c6857
3 files changed
+9 -3

No files matched your search

+3 -1
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
+3 -1
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
+3 -1
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