Permalink
Browse files

Initialize SSL field when adding a new bot

bi->ssl was not initialized when adding a new bot, resulting in incorrect status of the SSL port depending on the random value inside that field if the user had not explicitly set the port to SSL.
  • Loading branch information...
vanosg committed Nov 5, 2017
1 parent 5dea008 commit adebebe3f4399340d2b4e93393e532e5f48afe78
Showing with 2 additions and 0 deletions.
  1. +1 −0 src/cmds.c
  2. +1 −0 src/tcluser.c
View
@@ -872,6 +872,7 @@ static void cmd_pls_bot(struct userrec *u, int idx, char *par)
userlist = adduser(userlist, handle, "none", "-", USER_BOT);
u1 = get_user_by_handle(userlist, handle);
bi = user_malloc(sizeof(struct bot_addr));
bi->ssl = 0;
bi->address = user_malloc(strlen(addr) + 1);
strcpy(bi->address, addr);
View
@@ -309,6 +309,7 @@ static int tcl_addbot STDVAR
else {
userlist = adduser(userlist, argv[1], "none", "-", USER_BOT);
bi = user_malloc(sizeof(struct bot_addr));
bi->ssl = 0;
#ifdef IPV6
if ((q = strchr(argv[2], '/'))) {
if (!q[1]) {

0 comments on commit adebebe

Please sign in to comment.