[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [tor/master] Add assertions for correct input to handle_control_command.
commit f3bd0240a6089910f3075a779b32e7aed07338e0
Author: Nick Mathewson <nickm@xxxxxxxxxxxxxx>
Date: Mon Apr 1 17:29:46 2019 -0400
Add assertions for correct input to handle_control_command.
---
src/feature/control/control_cmd.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/feature/control/control_cmd.c b/src/feature/control/control_cmd.c
index 4fcfa7310..56202a7ef 100644
--- a/src/feature/control/control_cmd.c
+++ b/src/feature/control/control_cmd.c
@@ -2398,6 +2398,10 @@ handle_control_command(control_connection_t *conn,
uint32_t cmd_data_len,
char *args)
{
+ tor_assert(conn);
+ tor_assert(args);
+ tor_assert(args[cmd_data_len] == '\0');
+
for (unsigned i = 0; i < N_CONTROL_COMMANDS; ++i) {
const control_cmd_def_t *def = &CONTROL_COMMANDS[i];
if (!strcasecmp(conn->incoming_cmd, def->name)) {
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits