From c53911ec23848d13cbbaa10286895d874abd0b08 Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Sat, 20 May 2006 13:48:08 +0200 Subject: Fixed a string handling mistake and better stripping of servernames used in user_t structures. --- protocols/nogaim.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'protocols') diff --git a/protocols/nogaim.c b/protocols/nogaim.c index eee104c4..568afe33 100644 --- a/protocols/nogaim.c +++ b/protocols/nogaim.c @@ -482,7 +482,14 @@ void add_buddy( struct gaim_connection *gc, char *group, char *handle, char *rea } else if( gc->user->proto_opt[0] && *gc->user->proto_opt[0] ) { - u->host = g_strdup( gc->user->proto_opt[0] ); + char *colon; + + if( ( colon = strchr( gc->user->proto_opt[0], ':' ) ) ) + u->host = g_strndup( gc->user->proto_opt[0], + colon - gc->user->proto_opt[0] ); + else + u->host = g_strdup( gc->user->proto_opt[0] ); + u->user = g_strdup( handle ); /* s/ /_/ ... important for AOL screennames */ -- cgit v1.2.3 From f66c701e85ed9febdd065d0fd5808be3e8af6811 Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Sun, 21 May 2006 21:55:52 +0200 Subject: Modified oscar.c headers. --- protocols/oscar/oscar.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'protocols') diff --git a/protocols/oscar/oscar.c b/protocols/oscar/oscar.c index 53da1e27..fecc11c0 100644 --- a/protocols/oscar/oscar.c +++ b/protocols/oscar/oscar.c @@ -1,6 +1,8 @@ /* * gaim * + * Some code copyright (C) 2002-2006, Jelmer Vernooij + * and the BitlBee team. * Some code copyright (C) 1998-1999, Mark Spencer * libfaim code copyright 1998, 1999 Adam Fritzler * -- cgit v1.2.3 From 73cf7fd5f066d3c0720f58af840affa3e61bad12 Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Mon, 22 May 2006 11:11:49 +0200 Subject: Trying to fix charset issues with outgoing AIM chat messages. --- protocols/oscar/aim.h | 7 +++++-- protocols/oscar/chat.c | 14 +++++++++++++- protocols/oscar/oscar.c | 9 +++++++-- 3 files changed, 25 insertions(+), 5 deletions(-) (limited to 'protocols') diff --git a/protocols/oscar/aim.h b/protocols/oscar/aim.h index 24cd7730..93887103 100644 --- a/protocols/oscar/aim.h +++ b/protocols/oscar/aim.h @@ -727,8 +727,11 @@ struct aim_chat_exchangeinfo { char *lang2; }; -#define AIM_CHATFLAGS_NOREFLECT 0x0001 -#define AIM_CHATFLAGS_AWAY 0x0002 +#define AIM_CHATFLAGS_NOREFLECT 0x0001 +#define AIM_CHATFLAGS_AWAY 0x0002 +#define AIM_CHATFLAGS_UNICODE 0x0004 +#define AIM_CHATFLAGS_ISO_8859_1 0x0008 + int aim_chat_send_im(aim_session_t *sess, aim_conn_t *conn, guint16 flags, const char *msg, int msglen); int aim_chat_join(aim_session_t *sess, aim_conn_t *conn, guint16 exchange, const char *roomname, guint16 instance); int aim_chat_attachname(aim_conn_t *conn, guint16 exchange, const char *roomname, guint16 instance); diff --git a/protocols/oscar/chat.c b/protocols/oscar/chat.c index 033c2577..8843b499 100644 --- a/protocols/oscar/chat.c +++ b/protocols/oscar/chat.c @@ -158,7 +158,19 @@ int aim_chat_send_im(aim_session_t *sess, aim_conn_t *conn, guint16 flags, const */ if (flags & AIM_CHATFLAGS_AWAY) aim_addtlvtochain_noval(&otl, 0x0007); - + + /* [WvG] This wasn't there originally, but we really should send + the right charset flags, as we also do with normal + messages. Hope this will work. :-) */ + if (flags & AIM_CHATFLAGS_UNICODE) + aimbs_put16(&fr->data, 0x0002); + else if (flags & AIM_CHATFLAGS_ISO_8859_1) + aimbs_put16(&fr->data, 0x0003); + else + aimbs_put16(&fr->data, 0x0000); + + aimbs_put16(&fr->data, 0x0000); + /* * SubTLV: Type 1: Message */ diff --git a/protocols/oscar/oscar.c b/protocols/oscar/oscar.c index fecc11c0..4e75fe0a 100644 --- a/protocols/oscar/oscar.c +++ b/protocols/oscar/oscar.c @@ -2501,6 +2501,7 @@ int oscar_chat_send(struct gaim_connection * gc, int id, char *message) struct chat_connection * ccon; int ret; guint8 len = strlen(message); + guint16 flags; char *s; if(!(ccon = find_oscar_chat(gc, id))) @@ -2509,15 +2510,19 @@ int oscar_chat_send(struct gaim_connection * gc, int id, char *message) for (s = message; *s; s++) if (*s & 128) break; - + + flags = AIM_CHATFLAGS_NOREFLECT; + /* Message contains high ASCII chars, time for some translation! */ if (*s) { s = g_malloc(BUF_LONG); /* Try if we can put it in an ISO8859-1 string first. If we can't, fall back to UTF16. */ if ((ret = do_iconv("UTF-8", "ISO8859-1", message, s, len, BUF_LONG)) >= 0) { + flags |= AIM_CHATFLAGS_ISO_8859_1; len = ret; } else if ((ret = do_iconv("UTF-8", "UNICODEBIG", message, s, len, BUF_LONG)) >= 0) { + flags |= AIM_CHATFLAGS_UNICODE; len = ret; } else { /* OOF, translation failed... Oh well.. */ @@ -2528,7 +2533,7 @@ int oscar_chat_send(struct gaim_connection * gc, int id, char *message) s = message; } - ret = aim_chat_send_im(od->sess, ccon->conn, AIM_CHATFLAGS_NOREFLECT, s, len); + ret = aim_chat_send_im(od->sess, ccon->conn, flags, s, len); if (s != message) { g_free(s); -- cgit v1.2.3 From 226fce105c1189bde1aa321b494494d49b463e90 Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Tue, 23 May 2006 09:45:14 +0200 Subject: Some changes for im_api. (bim_* functions) --- protocols/nogaim.c | 197 +++++++++++++++++++++++++++-------------------------- protocols/nogaim.h | 6 +- 2 files changed, 105 insertions(+), 98 deletions(-) (limited to 'protocols') diff --git a/protocols/nogaim.c b/protocols/nogaim.c index 568afe33..a9b27e92 100644 --- a/protocols/nogaim.c +++ b/protocols/nogaim.c @@ -37,19 +37,6 @@ #include "nogaim.h" #include -static char *proto_away_alias[8][5] = -{ - { "Away from computer", "Away", "Extended away", NULL }, - { "NA", "N/A", "Not available", NULL }, - { "Busy", "Do not disturb", "DND", "Occupied", NULL }, - { "Be right back", "BRB", NULL }, - { "On the phone", "Phone", "On phone", NULL }, - { "Out to lunch", "Lunch", "Food", NULL }, - { "Invisible", "Hidden" }, - { NULL } -}; -static char *proto_away_alias_find( GList *gcm, char *away ); - static int remove_chat_buddy_silent( struct conversation *b, char *handle ); GSList *connections; @@ -157,83 +144,6 @@ void nogaim_init() GSList *get_connections() { return connections; } -int proto_away( struct gaim_connection *gc, char *away ) -{ - GList *m, *ms; - char *s; - - if( !away ) away = ""; - ms = m = gc->prpl->away_states( gc ); - - while( m ) - { - if( *away ) - { - if( g_strncasecmp( m->data, away, strlen( m->data ) ) == 0 ) - break; - } - else - { - if( g_strcasecmp( m->data, "Available" ) == 0 ) - break; - if( g_strcasecmp( m->data, "Online" ) == 0 ) - break; - } - m = m->next; - } - - if( m ) - { - gc->prpl->set_away( gc, m->data, *away ? away : NULL ); - } - else - { - s = proto_away_alias_find( ms, away ); - if( s ) - { - gc->prpl->set_away( gc, s, away ); - if( set_getint( gc->irc, "debug" ) ) - serv_got_crap( gc, "Setting away state to %s", s ); - } - else - gc->prpl->set_away( gc, GAIM_AWAY_CUSTOM, away ); - } - - g_list_free( ms ); - - return( 1 ); -} - -static char *proto_away_alias_find( GList *gcm, char *away ) -{ - GList *m; - int i, j; - - for( i = 0; *proto_away_alias[i]; i ++ ) - { - for( j = 0; proto_away_alias[i][j]; j ++ ) - if( g_strncasecmp( away, proto_away_alias[i][j], strlen( proto_away_alias[i][j] ) ) == 0 ) - break; - - if( !proto_away_alias[i][j] ) /* If we reach the end, this row */ - continue; /* is not what we want. Next! */ - - /* Now find an entry in this row which exists in gcm */ - for( j = 0; proto_away_alias[i][j]; j ++ ) - { - m = gcm; - while( m ) - { - if( g_strcasecmp( proto_away_alias[i][j], m->data ) == 0 ) - return( proto_away_alias[i][j] ); - m = m->next; - } - } - } - - return( NULL ); -} - /* multi.c */ struct gaim_connection *new_gaim_conn( struct aim_user *user ) @@ -358,7 +268,7 @@ void account_online( struct gaim_connection *gc ) /* Also necessary when we're not away, at least for some of the protocols. */ - proto_away( gc, u->away ); + bim_set_away( gc, u->away ); } gboolean auto_reconnect( gpointer data ) @@ -1030,24 +940,30 @@ char *set_eval_away_devoice( irc_t *irc, set_t *set, char *value ) return( set_eval_bool( irc, set, value ) ); } -int serv_send_im( irc_t *irc, user_t *u, char *msg, int flags ) + + + +/* The plan is to not allow straight calls to prpl functions anymore, but do + them all from some wrappers. We'll start to define some down here: */ + +int bim_buddy_msg( struct gaim_connection *gc, char *handle, char *msg, int flags ) { char *buf = NULL; int st; - if( ( u->gc->flags & OPT_CONN_HTML ) && ( g_strncasecmp( msg, "", 6 ) != 0 ) ) + if( ( gc->flags & OPT_CONN_HTML ) && ( g_strncasecmp( msg, "", 6 ) != 0 ) ) { buf = escape_html( msg ); msg = buf; } - st = ((struct gaim_connection *)u->gc)->prpl->send_im( u->gc, u->handle, msg, strlen( msg ), flags ); + st = gc->prpl->send_im( gc, handle, msg, strlen( msg ), flags ); g_free( buf ); return st; } -int serv_send_chat( irc_t *irc, struct gaim_connection *gc, int id, char *msg ) +int bim_chat_msg( struct gaim_connection *gc, int id, char *msg ) { char *buf = NULL; int st; @@ -1063,3 +979,94 @@ int serv_send_chat( irc_t *irc, struct gaim_connection *gc, int id, char *msg ) return st; } + +static char *bim_away_alias_find( GList *gcm, char *away ); + +int bim_set_away( struct gaim_connection *gc, char *away ) +{ + GList *m, *ms; + char *s; + + if( !away ) away = ""; + ms = m = gc->prpl->away_states( gc ); + + while( m ) + { + if( *away ) + { + if( g_strncasecmp( m->data, away, strlen( m->data ) ) == 0 ) + break; + } + else + { + if( g_strcasecmp( m->data, "Available" ) == 0 ) + break; + if( g_strcasecmp( m->data, "Online" ) == 0 ) + break; + } + m = m->next; + } + + if( m ) + { + gc->prpl->set_away( gc, m->data, *away ? away : NULL ); + } + else + { + s = bim_away_alias_find( ms, away ); + if( s ) + { + gc->prpl->set_away( gc, s, away ); + if( set_getint( gc->irc, "debug" ) ) + serv_got_crap( gc, "Setting away state to %s", s ); + } + else + gc->prpl->set_away( gc, GAIM_AWAY_CUSTOM, away ); + } + + g_list_free( ms ); + + return( 1 ); +} + +static char *bim_away_alias_list[8][5] = +{ + { "Away from computer", "Away", "Extended away", NULL }, + { "NA", "N/A", "Not available", NULL }, + { "Busy", "Do not disturb", "DND", "Occupied", NULL }, + { "Be right back", "BRB", NULL }, + { "On the phone", "Phone", "On phone", NULL }, + { "Out to lunch", "Lunch", "Food", NULL }, + { "Invisible", "Hidden" }, + { NULL } +}; + +static char *bim_away_alias_find( GList *gcm, char *away ) +{ + GList *m; + int i, j; + + for( i = 0; *bim_away_alias_list[i]; i ++ ) + { + for( j = 0; bim_away_alias_list[i][j]; j ++ ) + if( g_strncasecmp( away, bim_away_alias_list[i][j], strlen( bim_away_alias_list[i][j] ) ) == 0 ) + break; + + if( !bim_away_alias_list[i][j] ) /* If we reach the end, this row */ + continue; /* is not what we want. Next! */ + + /* Now find an entry in this row which exists in gcm */ + for( j = 0; bim_away_alias_list[i][j]; j ++ ) + { + m = gcm; + while( m ) + { + if( g_strcasecmp( bim_away_alias_list[i][j], m->data ) == 0 ) + return( bim_away_alias_list[i][j] ); + m = m->next; + } + } + } + + return( NULL ); +} diff --git a/protocols/nogaim.h b/protocols/nogaim.h index 4251fbaa..3b55fe3b 100644 --- a/protocols/nogaim.h +++ b/protocols/nogaim.h @@ -193,11 +193,11 @@ G_MODULE_EXPORT struct prpl *find_protocol(const char *name); G_MODULE_EXPORT void register_protocol(struct prpl *); /* nogaim.c */ -int serv_send_im(irc_t *irc, user_t *u, char *msg, int flags); -int serv_send_chat(irc_t *irc, struct gaim_connection *gc, int id, char *msg ); +int bim_set_away( struct gaim_connection *gc, char *away ); +int bim_buddy_msg( struct gaim_connection *gc, char *handle, char *msg, int flags ); +int bim_chat_msg( struct gaim_connection *gc, int id, char *msg ); void nogaim_init(); -int proto_away( struct gaim_connection *gc, char *away ); char *set_eval_away_devoice( irc_t *irc, set_t *set, char *value ); gboolean auto_reconnect( gpointer data ); -- cgit v1.2.3 From da3b53657c8e554fc8c28c8ef61ef44492da24dd Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Tue, 23 May 2006 10:09:16 +0200 Subject: Added bim_ functions for block/allow list management to keep gc->permit/deny up-to-date at run-time. --- protocols/nogaim.c | 46 ++++++++++++++++++++++++++++++++++++++++++++++ protocols/nogaim.h | 5 +++++ 2 files changed, 51 insertions(+) (limited to 'protocols') diff --git a/protocols/nogaim.c b/protocols/nogaim.c index a9b27e92..04d48236 100644 --- a/protocols/nogaim.c +++ b/protocols/nogaim.c @@ -1070,3 +1070,49 @@ static char *bim_away_alias_find( GList *gcm, char *away ) return( NULL ); } + +void bim_add_allow( struct gaim_connection *gc, char *handle ) +{ + if( g_slist_find_custom( gc->permit, handle, (GCompareFunc) gc->prpl->cmp_buddynames ) == NULL ) + { + gc->permit = g_slist_prepend( gc->permit, g_strdup( handle ) ); + } + + gc->prpl->add_permit( gc, handle ); +} + +void bim_rem_allow( struct gaim_connection *gc, char *handle ) +{ + GSList *l; + + if( ( l = g_slist_find_custom( gc->permit, handle, (GCompareFunc) gc->prpl->cmp_buddynames ) ) ) + { + g_free( l->data ); + gc->permit = g_slist_delete_link( gc->permit, l ); + } + + gc->prpl->rem_permit( gc, handle ); +} + +void bim_add_block( struct gaim_connection *gc, char *handle ) +{ + if( g_slist_find_custom( gc->deny, handle, (GCompareFunc) gc->prpl->cmp_buddynames ) == NULL ) + { + gc->deny = g_slist_prepend( gc->deny, g_strdup( handle ) ); + } + + gc->prpl->add_deny( gc, handle ); +} + +void bim_rem_block( struct gaim_connection *gc, char *handle ) +{ + GSList *l; + + if( ( l = g_slist_find_custom( gc->deny, handle, (GCompareFunc) gc->prpl->cmp_buddynames ) ) ) + { + g_free( l->data ); + gc->deny = g_slist_delete_link( gc->deny, l ); + } + + gc->prpl->rem_deny( gc, handle ); +} diff --git a/protocols/nogaim.h b/protocols/nogaim.h index 3b55fe3b..54a1835b 100644 --- a/protocols/nogaim.h +++ b/protocols/nogaim.h @@ -197,6 +197,11 @@ int bim_set_away( struct gaim_connection *gc, char *away ); int bim_buddy_msg( struct gaim_connection *gc, char *handle, char *msg, int flags ); int bim_chat_msg( struct gaim_connection *gc, int id, char *msg ); +void bim_add_allow( struct gaim_connection *gc, char *handle ); +void bim_rem_allow( struct gaim_connection *gc, char *handle ); +void bim_add_block( struct gaim_connection *gc, char *handle ); +void bim_rem_block( struct gaim_connection *gc, char *handle ); + void nogaim_init(); char *set_eval_away_devoice( irc_t *irc, set_t *set, char *value ); -- cgit v1.2.3 From a9ca7dd4d4b6dc55be46bbbdd166922c69a73590 Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Tue, 23 May 2006 10:18:24 +0200 Subject: Added G_GNUC_PRINTF(...) to definitions of functions that take format strings so GCC can detect them and complain when things don't look right. --- protocols/nogaim.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'protocols') diff --git a/protocols/nogaim.h b/protocols/nogaim.h index 54a1835b..282a2455 100644 --- a/protocols/nogaim.h +++ b/protocols/nogaim.h @@ -214,7 +214,7 @@ G_MODULE_EXPORT void destroy_gaim_conn( struct gaim_connection *gc ); G_MODULE_EXPORT void set_login_progress( struct gaim_connection *gc, int step, char *msg ); G_MODULE_EXPORT void hide_login_progress( struct gaim_connection *gc, char *msg ); G_MODULE_EXPORT void hide_login_progress_error( struct gaim_connection *gc, char *msg ); -G_MODULE_EXPORT void serv_got_crap( struct gaim_connection *gc, char *format, ... ); +G_MODULE_EXPORT void serv_got_crap( struct gaim_connection *gc, char *format, ... ) G_GNUC_PRINTF( 2, 3 ); G_MODULE_EXPORT void account_online( struct gaim_connection *gc ); G_MODULE_EXPORT void signoff( struct gaim_connection *gc ); -- cgit v1.2.3 From fc630f9fb47690c30feaf4738727a213d633afc9 Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Tue, 23 May 2006 10:31:04 +0200 Subject: Silenced all compiler warnings that appeared after previous commit. --- protocols/oscar/oscar.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'protocols') diff --git a/protocols/oscar/oscar.c b/protocols/oscar/oscar.c index 4e75fe0a..5174f95c 100644 --- a/protocols/oscar/oscar.c +++ b/protocols/oscar/oscar.c @@ -384,7 +384,7 @@ static void oscar_login(struct aim_user *user) { if (g_strcasecmp(user->proto_opt[USEROPT_AUTH], "login.icq.com") != 0 && g_strcasecmp(user->proto_opt[USEROPT_AUTH], "login.oscar.aol.com") != 0) { - serv_got_crap(gc, "Warning: Unknown OSCAR server: `%s'. Please review your configuration if the connection fails."); + serv_got_crap(gc, "Warning: Unknown OSCAR server: `%s'. Please review your configuration if the connection fails.",user->proto_opt[USEROPT_AUTH]); } g_snprintf(buf, sizeof(buf), _("Signon: %s"), gc->username); -- cgit v1.2.3 From 936ded65a76dac7a7af56ef3f1ad6c84a32270c6 Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Thu, 25 May 2006 10:57:31 +0200 Subject: Disabling chat charset stuff again for now and fixed the crash-bug. Unfortunately I can't figure out how to generate chat names that don't break old BitlBees. --- protocols/oscar/chat.c | 2 ++ protocols/oscar/oscar.c | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'protocols') diff --git a/protocols/oscar/chat.c b/protocols/oscar/chat.c index 8843b499..df535c4f 100644 --- a/protocols/oscar/chat.c +++ b/protocols/oscar/chat.c @@ -162,6 +162,7 @@ int aim_chat_send_im(aim_session_t *sess, aim_conn_t *conn, guint16 flags, const /* [WvG] This wasn't there originally, but we really should send the right charset flags, as we also do with normal messages. Hope this will work. :-) */ + /* if (flags & AIM_CHATFLAGS_UNICODE) aimbs_put16(&fr->data, 0x0002); else if (flags & AIM_CHATFLAGS_ISO_8859_1) @@ -170,6 +171,7 @@ int aim_chat_send_im(aim_session_t *sess, aim_conn_t *conn, guint16 flags, const aimbs_put16(&fr->data, 0x0000); aimbs_put16(&fr->data, 0x0000); + */ /* * SubTLV: Type 1: Message diff --git a/protocols/oscar/oscar.c b/protocols/oscar/oscar.c index 5174f95c..c2716c6b 100644 --- a/protocols/oscar/oscar.c +++ b/protocols/oscar/oscar.c @@ -137,9 +137,9 @@ static char *extract_name(const char *name) { char *tmp; int i, j; char *x = strchr(name, '-'); - if (!x) return NULL; + if (!x) return g_strdup(name); x = strchr(++x, '-'); - if (!x) return NULL; + if (!x) return g_strdup(name); tmp = g_strdup(++x); for (i = 0, j = 0; x[i]; i++) { @@ -2606,9 +2606,9 @@ int oscar_chat_open(struct gaim_connection * gc, char *who) struct oscar_data * od = (struct oscar_data *)gc->proto_data; int ret; static int chat_id = 0; - char * chatname = g_new0(char, strlen(gc->username)+4); + char * chatname; - g_snprintf(chatname, strlen(gc->username) + 4, "%s%d", gc->username, chat_id++); + chatname = g_strdup_printf("%s%d", gc->username, chat_id++); ret = oscar_chat_join(gc, chatname); -- cgit v1.2.3 From 1c8a7a232935d1c2b7f1916faae11d730624bdc3 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Thu, 25 May 2006 11:46:36 +0200 Subject: Fix typo --- protocols/nogaim.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'protocols') diff --git a/protocols/nogaim.h b/protocols/nogaim.h index 282a2455..8744054a 100644 --- a/protocols/nogaim.h +++ b/protocols/nogaim.h @@ -51,7 +51,7 @@ #define SELF_ALIAS_LEN 400 #define BUDDY_ALIAS_MAXLEN 388 /* because MSN names can be 387 characters */ -#define WEBSITE "http://www.bitlee.org/" +#define WEBSITE "http://www.bitlbee.org/" #define IM_FLAG_AWAY 0x0020 #define OPT_CONN_HTML 0x00000001 #define OPT_LOGGED_IN 0x00010000 -- cgit v1.2.3 From 0602496cb6cedc917abbd0a12468e9329c6967e1 Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Thu, 25 May 2006 13:22:06 +0200 Subject: Better handling of completely empty HTTP replies in http_client.c. --- protocols/http_client.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'protocols') diff --git a/protocols/http_client.c b/protocols/http_client.c index 5db31782..e181438c 100644 --- a/protocols/http_client.c +++ b/protocols/http_client.c @@ -239,6 +239,11 @@ static void http_incoming_data( gpointer data, int source, GaimInputCondition co return; got_reply: + /* Maybe if the webserver is overloaded, or when there's bad SSL + support... */ + if( req->bytes_read == 0 ) + goto cleanup; + /* Zero termination is very convenient. */ req->reply_headers[req->bytes_read] = 0; -- cgit v1.2.3 From 7bfd574a6dc85b365f4a7a397ad5ca681faeb0e4 Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Fri, 26 May 2006 10:57:36 +0200 Subject: Fixed a NULL pointer dereference that showed up on testing.b.o sometimes. --- protocols/oscar/im.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'protocols') diff --git a/protocols/oscar/im.c b/protocols/oscar/im.c index c829d409..7cccabc7 100644 --- a/protocols/oscar/im.c +++ b/protocols/oscar/im.c @@ -1468,7 +1468,7 @@ static void incomingim_ch2_icqserverrelay(aim_session_t *sess, aim_module_t *mod case AIM_MTYPE_AUTOFFC: case 0x9c: /* ICQ 5 seems to send this */ aim_send_im_ch2_statusmessage(sess, userinfo->sn, args->cookie, - gc->away, sess->aim_icq_state, dc); + gc->away ? gc->away : "", sess->aim_icq_state, dc); break; } -- cgit v1.2.3