does not have it defined. Affected files are
lib/silcutil/[unix/win32]/silc[unix/win32]net.c.
+ * Fixed buffer overflow from Irssi SILC Client. Affected
+ file irssi/src/fe-common/core/themes.c.
+
+ * Fixed double free in client library in the file
+ lib/silcclient/client.c when disconnecting from server.
+
+ * Applied double free patch from cras to Irssi SILC client.
+ Affected files irssi/src/core/[modules/expandos].c
+
+ * Fixed the disconnection handling to Irssi SILC Client.
+ The application must call silc_client_close_connection
+ in ops->connect client operation in case of failure of
+ the connection. Affected file is
+ irssi/src/silc/core/client_ops.c.
+
+ * Do not set sock->protocol to NULL in the function
+ silc_client_close_connection after executing the protocol's
+ final callback since the sock might not be valid anymore.
+ Affected file lib/silcclient/client.c.
+
Wed Jul 25 16:04:35 EEST 2001 Pekka Riikonen <priikone@silcnet.org>
* Do not enable SILC_THREADS if the linking with libpthread
} else if (g_hash_table_lookup_extended(expandos, key, &origkey,
(gpointer *) &rec)) {
if (rec->func == func) {
- g_free(origkey);
g_hash_table_remove(expandos, key);
+ g_free(origkey);
g_free(rec);
}
}
static void uniq_get_modules(char *key, void *value, GSList **list)
{
- *list = g_slist_append(*list, key);
+ *list = g_slist_append(*list, g_strdup(key));
}
void modules_init(void)
while (list != NULL) {
module_uniq_destroy(list->data);
+ g_free(list->data);
list = g_slist_remove(list, list->data);
}
static const char *bgcolorformats = "n01234567";
#define IS_FGCOLOR_FORMAT(c) \
- ((c) != '\0' && strchr(fgcolorformats, c) != NULL)
+ ((c) != '\0' && strchr(fgcolorformats, (c)) != NULL)
#define IS_BGCOLOR_FORMAT(c) \
- ((c) != '\0' && strchr(bgcolorformats, c) != NULL)
+ ((c) != '\0' && strchr(bgcolorformats, (c)) != NULL)
/* append "variable" part in $variable, ie. not the contents of the variable */
static void theme_format_append_variable(GString *str, const char **format)
if (IS_OLD_FORMAT(*format, last_fg, last_bg)) {
/* active color set again */
} else if (IS_FGCOLOR_FORMAT(*format) &&
- (*format != 'n' || format[2] == 'n') &&
format[1] == '%' &&
- IS_FGCOLOR_FORMAT(format[2])) {
+ IS_FGCOLOR_FORMAT(format[2]) &&
+ (*format != 'n' || format[2] == 'n')) {
/* two fg colors in a row. bg colors are
so rare that we don't bother checking
them */
{
SILC_SERVER_REC *server = conn->context;
+ if (!server && !success) {
+ silc_client_close_connection(client, NULL, conn);
+ return;
+ }
+
if (success) {
server->connected = TRUE;
signal_emit("event connected", 1, server);
/* Allocate new socket connection object */
silc_socket_alloc(fd, SILC_SOCKET_TYPE_SERVER, (void *)conn, &conn->sock);
+ /* Sometimes when doing quick reconnects the new socket may be same as
+ the old one and there might be pending stuff for the old socket.
+ If new one is same then those pending sutff might cause problems.
+ Make sure they do not do that. */
+ silc_schedule_task_del_by_fd(client->schedule, fd);
+
conn->nickname = strdup(client->username);
conn->sock->hostname = conn->remote_host;
conn->sock->ip = strdup(conn->remote_host);
SILC_PROTOCOL_CLIENT_CONNECTION_AUTH) {
sock->protocol->state = SILC_PROTOCOL_STATE_ERROR;
silc_protocol_execute_final(sock->protocol, client->schedule);
- sock->protocol = NULL;
/* The application will recall this function with these protocols
(the ops->connect client operation). */
return;
if (conn->server_cache)
silc_idcache_del_all(conn->server_cache);
- /* Free data */
+ /* Free data (my ID is freed in above silc_client_del_client) */
if (conn->remote_host)
silc_free(conn->remote_host);
- if (conn->local_id)
- silc_free(conn->local_id);
if (conn->local_id_data)
silc_free(conn->local_id_data);
if (conn->send_key)
/* Called to indicate that connection was either successfully established
or connecting failed. This is also the first time application receives
- the SilcClientConnection objecet which it should save somewhere. */
+ the SilcClientConnection objecet which it should save somewhere.
+ If the `success' is FALSE the application must always call the function
+ silc_client_close_connection. */
void (*connect)(SilcClient client, SilcClientConnection conn, int success);
/* Called to indicate that connection was disconnected to the server. */