Skip to content
Permalink
Browse files Browse the repository at this point in the history
Merge pull request #1058 from ailin-nemui/sasl-reconnect
copy sasl username and password values
  • Loading branch information
ailin-nemui committed Jun 28, 2019
2 parents d34bd85 + 5a67b98 commit d23b0d2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions src/irc/core/irc-core.c
Expand Up @@ -75,6 +75,8 @@ static void destroy_server_connect(SERVER_CONNECT_REC *conn)

g_free_not_null(ircconn->usermode);
g_free_not_null(ircconn->alternate_nick);
g_free_not_null(ircconn->sasl_username);
g_free_not_null(ircconn->sasl_password);
}

void irc_core_init(void)
Expand Down
4 changes: 2 additions & 2 deletions src/irc/core/irc-servers-reconnect.c
Expand Up @@ -49,8 +49,8 @@ static void sig_server_connect_copy(SERVER_CONNECT_REC **dest,
rec->usermode = g_strdup(src->usermode);
rec->alternate_nick = g_strdup(src->alternate_nick);
rec->sasl_mechanism = src->sasl_mechanism;
rec->sasl_username = src->sasl_username;
rec->sasl_password = src->sasl_password;
rec->sasl_username = g_strdup(src->sasl_username);
rec->sasl_password = g_strdup(src->sasl_password);
*dest = (SERVER_CONNECT_REC *) rec;
}

Expand Down
4 changes: 2 additions & 2 deletions src/irc/core/irc-servers-setup.c
Expand Up @@ -101,8 +101,8 @@ static void sig_server_setup_fill_chatnet(IRC_SERVER_CONNECT_REC *conn,
conn->sasl_mechanism = SASL_MECHANISM_PLAIN;
if (ircnet->sasl_username != NULL && *ircnet->sasl_username &&
ircnet->sasl_password != NULL && *ircnet->sasl_password) {
conn->sasl_username = ircnet->sasl_username;
conn->sasl_password = ircnet->sasl_password;
conn->sasl_username = g_strdup(ircnet->sasl_username);
conn->sasl_password = g_strdup(ircnet->sasl_password);
} else
g_warning("The fields sasl_username and sasl_password are either missing or empty");
}
Expand Down

1 comment on commit d23b0d2

@h1z1
Copy link

@h1z1 h1z1 commented on d23b0d2 Jul 7, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For reference as it's not entirely clear what this change was for.

CVE-2019-13045 
Irssi before 1.0.8, 1.1.x before 1.1.3, and 1.2.x before 1.2.1, when SASL is enabled, has a use after free when sending SASL login to the server.

Please sign in to comment.