Sun, 03 Mar 2013 18:35:43 -0500
Merge with release-2.x.y
--- a/finch/gntpounce.c Tue Feb 26 21:59:46 2013 -0500 +++ b/finch/gntpounce.c Sun Mar 03 18:35:43 2013 -0500 @@ -801,10 +801,8 @@ if (purple_pounce_action_is_enabled(pounce, "open-window")) { - conv = purple_find_conversation_with_account(PURPLE_CONV_TYPE_IM, pouncee, account); - - if (conv == NULL) - conv = purple_conversation_new(PURPLE_CONV_TYPE_IM, account, pouncee); + if (!purple_find_conversation_with_account(PURPLE_CONV_TYPE_IM, pouncee, account)) + purple_conversation_new(PURPLE_CONV_TYPE_IM, account, pouncee); } if (purple_pounce_action_is_enabled(pounce, "popup-notify"))
--- a/finch/libgnt/gntwm.c Tue Feb 26 21:59:46 2013 -0500 +++ b/finch/libgnt/gntwm.c Sun Mar 03 18:35:43 2013 -0500 @@ -1243,7 +1243,11 @@ static gboolean ignore_keys_end(GntBindable *bindable, GList *n) { - return ignore_keys ? !(ignore_keys = FALSE) : FALSE; + if (ignore_keys) { + ignore_keys = FALSE; + return TRUE; + } + return FALSE; } static gboolean
--- a/libpurple/example/nullclient.c Tue Feb 26 21:59:46 2013 -0500 +++ b/libpurple/example/nullclient.c Sun Mar 03 18:35:43 2013 -0500 @@ -242,7 +242,7 @@ GList *iter; int i, num; GList *names = NULL; - const char *prpl; + const char *prpl = NULL; char name[128]; char *password; GMainLoop *loop = g_main_loop_new(NULL, FALSE); @@ -278,8 +278,12 @@ fprintf(stderr, "Failed to gets protocol selection."); abort(); } - sscanf(name, "%d", &num); - prpl = g_list_nth_data(names, num); + if (sscanf(name, "%d", &num) == 1) + prpl = g_list_nth_data(names, num); + if (!prpl) { + fprintf(stderr, "Failed to gets protocol."); + abort(); + } printf("Username: "); res = fgets(name, sizeof(name), stdin);
--- a/libpurple/plugins/ssl/ssl-nss.c Tue Feb 26 21:59:46 2013 -0500 +++ b/libpurple/plugins/ssl/ssl-nss.c Sun Mar 03 18:35:43 2013 -0500 @@ -756,7 +756,7 @@ subjectCert = X509_NSS_DATA(crt); g_return_val_if_fail(subjectCert, FALSE); - if (subjectCert->issuerName == NULL + if (subjectCert->issuerName == NULL || issuerCert->subjectName == NULL || PORT_Strcmp(subjectCert->issuerName, issuerCert->subjectName) != 0) return FALSE; st = CERT_VerifySignedData(&subjectCert->signatureWrap, issuerCert, PR_Now(), NULL);
--- a/libpurple/protocols/irc/msgs.c Tue Feb 26 21:59:46 2013 -0500 +++ b/libpurple/protocols/irc/msgs.c Sun Mar 03 18:35:43 2013 -0500 @@ -99,7 +99,7 @@ /* If we're away then set our away message */ status = purple_account_get_active_status(irc->account); - if (!purple_status_get_type(status) != PURPLE_STATUS_AVAILABLE) { + if (purple_status_get_type(status) != PURPLE_STATUS_AVAILABLE) { PurplePluginProtocolInfo *prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(purple_connection_get_prpl(gc)); prpl_info->set_status(irc->account, status); }
--- a/libpurple/protocols/irc/parse.c Tue Feb 26 21:59:46 2013 -0500 +++ b/libpurple/protocols/irc/parse.c Sun Mar 03 18:35:43 2013 -0500 @@ -559,14 +559,16 @@ return buf; } else if (!strncmp(cur, "PING ", 5)) { if (notice) { /* reply */ - /* TODO: Should this read in the timestamp as a double? */ - sscanf(cur, "PING %lu", ×tamp); gc = purple_account_get_connection(irc->account); if (!gc) return NULL; - buf = g_strdup_printf(_("Reply time from %s: %lu seconds"), from, time(NULL) - timestamp); - purple_notify_info(gc, _("PONG"), _("CTCP PING reply"), buf); - g_free(buf); + /* TODO: Should this read in the timestamp as a double? */ + if (sscanf(cur, "PING %lu", ×tamp) == 1) { + buf = g_strdup_printf(_("Reply time from %s: %lu seconds"), from, time(NULL) - timestamp); + purple_notify_info(gc, _("PONG"), _("CTCP PING reply"), buf); + g_free(buf); + } else + purple_debug(PURPLE_DEBUG_ERROR, "irc", "Unable to parse PING timestamp"); return NULL; } else { buf = irc_format(irc, "vt:", "NOTICE", from, msg);
--- a/libpurple/protocols/jabber/auth_cyrus.c Tue Feb 26 21:59:46 2013 -0500 +++ b/libpurple/protocols/jabber/auth_cyrus.c Sun Mar 03 18:35:43 2013 -0500 @@ -178,6 +178,25 @@ purple_account_set_enabled(account, purple_core_get_ui(), FALSE); } +static gboolean remove_current_mech(JabberStream *js) { + char *pos; + if ((pos = strstr(js->sasl_mechs->str, js->current_mech))) { + int len = strlen(js->current_mech); + /* Clean up space that separated this Mech from the one before or after it */ + if (pos > js->sasl_mechs->str && *(pos - 1) == ' ') { + /* Handle removing space before when current_mech isn't the first mech in the list */ + pos--; + len++; + } else if (strlen(pos) > len && *(pos + len) == ' ') { + /* Handle removing space after */ + len++; + } + g_string_erase(js->sasl_mechs, pos - js->sasl_mechs->str, len); + return TRUE; + } + return FALSE; +} + static JabberSaslState jabber_auth_start_cyrus(JabberStream *js, xmlnode **reply, char **error) { @@ -299,14 +318,8 @@ * supported mechanisms. This code handles that case */ if (js->current_mech && *js->current_mech) { - char *pos; - if ((pos = strstr(js->sasl_mechs->str, js->current_mech))) { - g_string_erase(js->sasl_mechs, pos-js->sasl_mechs->str, strlen(js->current_mech)); - } - /* Remove space which separated this mech from the next */ - if ((js->sasl_mechs->str)[0] == ' ') { - g_string_erase(js->sasl_mechs, 0, 1); - } + remove_current_mech(js); + /* Should we only try again if we've removed the mech? */ again = TRUE; } @@ -545,15 +558,10 @@ { if (js->auth_fail_count++ < 5) { if (js->current_mech && *js->current_mech) { - char *pos; - if ((pos = strstr(js->sasl_mechs->str, js->current_mech))) { - g_string_erase(js->sasl_mechs, pos-js->sasl_mechs->str, strlen(js->current_mech)); - } - /* Remove space which separated this mech from the next */ - if ((js->sasl_mechs->str)[0] == ' ') { - g_string_erase(js->sasl_mechs, 0, 1); - } + remove_current_mech(js); } + + /* Should we only try again if we've actually removed a mech? */ if (*js->sasl_mechs->str) { /* If we have remaining mechs to try, do so */ sasl_dispose(&js->sasl);
--- a/libpurple/protocols/jabber/ibb.c Tue Feb 26 21:59:46 2013 -0500 +++ b/libpurple/protocols/jabber/ibb.c Sun Mar 03 18:35:43 2013 -0500 @@ -472,10 +472,6 @@ purple_debug_info("jabber", "IBB: calling closed handler\n"); sess->closed_cb(sess); } - - } else { - /* this should never happen */ - purple_debug_error("jabber", "Received bogus iq for IBB session\n"); } } else if (open) { JabberIq *result;
--- a/libpurple/protocols/jabber/oob.c Tue Feb 26 21:59:46 2013 -0500 +++ b/libpurple/protocols/jabber/oob.c Sun Mar 03 18:35:43 2013 -0500 @@ -138,8 +138,13 @@ lenstr = strstr(jox->headers->str, "Content-Length: "); if(lenstr) { goffset size; - sscanf(lenstr, "Content-Length: %" G_GOFFSET_FORMAT, &size); - purple_xfer_set_size(xfer, size); + if (sscanf(lenstr, "Content-Length: %" G_GOFFSET_FORMAT, &size) == 1) + purple_xfer_set_size(xfer, size); + else { + purple_debug_error("jabber", "Unable to parse Content-Length!\n"); + purple_xfer_cancel_local(xfer); + return 0; + } } purple_xfer_set_read_fnc(xfer, NULL);
--- a/libpurple/protocols/jabber/usermood.c Tue Feb 26 21:59:46 2013 -0500 +++ b/libpurple/protocols/jabber/usermood.c Sun Mar 03 18:35:43 2013 -0500 @@ -162,11 +162,9 @@ newmood = target_mood ? target_mood->mood : NULL; } - if (newmood != NULL && moodtext != NULL) - break; } if (newmood != NULL && moodtext != NULL) - break; + break; } if (newmood != NULL) { purple_prpl_got_user_status(purple_connection_get_account(js->gc), from, "mood",
--- a/libpurple/protocols/msn/soap.c Tue Feb 26 21:59:46 2013 -0500 +++ b/libpurple/protocols/msn/soap.c Sun Mar 03 18:35:43 2013 -0500 @@ -426,7 +426,8 @@ g_free(line); return; } else if (strcmp(key, "Content-Length") == 0) { - sscanf(value, "%" G_GSIZE_FORMAT, &(conn->body_len)); + if (sscanf(value, "%" G_GSIZE_FORMAT, &(conn->body_len)) != 1) + purple_debug_error("soap", "Unable to parse Content-Length\n"); } else if (strcmp(key, "Connection") == 0) { if (strcmp(value, "close") == 0) { conn->close_when_done = TRUE;
--- a/libpurple/protocols/mxit/protocol.c Tue Feb 26 21:59:46 2013 -0500 +++ b/libpurple/protocols/mxit/protocol.c Sun Mar 03 18:35:43 2013 -0500 @@ -868,9 +868,15 @@ ); /* add attributes */ - for ( i = 1; i < nr_attrib * 3; i+=3 ) + for ( i = 1; i < nr_attrib * 3; i+=3 ) { + if ( parts == NULL || parts[i] == NULL || parts[i + 1] == NULL || parts[i + 2] == NULL ) { + purple_debug_error( MXIT_PLUGIN_ID, "Invalid profile update attributes = '%s' - nbr=%u\n", attributes, nr_attrib ); + g_strfreev( parts ); + return; + } datalen += sprintf( data + datalen, "%c%s%c%s%c%s", /* \1name\1type\1value */ CP_FLD_TERM, parts[i], CP_FLD_TERM, parts[i + 1], CP_FLD_TERM, parts[i + 2] ); + } /* queue packet for transmission */ mxit_queue_packet( session, data, datalen, CP_CMD_EXTPROFILE_SET );
--- a/libpurple/protocols/novell/novell.c Tue Feb 26 21:59:46 2013 -0500 +++ b/libpurple/protocols/novell/novell.c Sun Mar 03 18:35:43 2013 -0500 @@ -3314,7 +3314,6 @@ for (node = purple_connection_get_account(gc)->permit; node; node = node->next) { dn = nm_lookup_dn(user, (char *)node->data); if (dn) { - user_record = nm_find_user_record(user, dn); if (!g_slist_find_custom(user->allow_list, dn, (GCompareFunc)purple_utf8_strcasecmp)) {
--- a/libpurple/protocols/oscar/oscar.c Tue Feb 26 21:59:46 2013 -0500 +++ b/libpurple/protocols/oscar/oscar.c Sun Mar 03 18:35:43 2013 -0500 @@ -2686,7 +2686,6 @@ } static int purple_selfinfo(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...) { - int warning_level; va_list ap; aim_userinfo_t *info; @@ -2696,15 +2695,6 @@ purple_connection_set_display_name(od->gc, info->bn); - /* - * What's with the + 0.5? - * The 0.5 is basically poor-man's rounding. Normally - * casting "13.7" to an int will truncate to "13," but - * with 13.7 + 0.5 = 14.2, which becomes "14" when - * truncated. - */ - warning_level = info->warnlevel/10.0 + 0.5; - return 1; } @@ -4566,7 +4556,6 @@ OscarData *od = NULL; PurpleAccount *account = NULL; PurplePresence *presence; - PurpleStatus *status; aim_userinfo_t *userinfo = NULL; const char *name; @@ -4580,7 +4569,6 @@ userinfo = aim_locate_finduserinfo(od, name); presence = purple_buddy_get_presence(b); - status = purple_presence_get_active_status(presence); if (purple_presence_is_online(presence) == FALSE) { char *gname;
--- a/libpurple/protocols/oscar/userinfo.c Tue Feb 26 21:59:46 2013 -0500 +++ b/libpurple/protocols/oscar/userinfo.c Sun Mar 03 18:35:43 2013 -0500 @@ -382,7 +382,6 @@ struct buddyinfo *bi; gchar who[16]; PurpleNotifyUserInfo *user_info; - const gchar *alias; if (!info->uin) return;
--- a/libpurple/protocols/silc/chat.c Tue Feb 26 21:59:46 2013 -0500 +++ b/libpurple/protocols/silc/chat.c Sun Mar 03 18:35:43 2013 -0500 @@ -151,7 +151,7 @@ } if (channel->mode) { - g_string_append_printf(s, _("<br><b>Channel Modes:</b> ")); + g_string_append(s, _("<br><b>Channel Modes:</b> ")); silcpurple_get_chmode_string(channel->mode, tmp, sizeof(tmp)); g_string_append(s, tmp); } @@ -1225,7 +1225,7 @@ SilcChannelUser chu; SilcChannelEntry channel = NULL; SilcChannelPrivateKey key = NULL; - SilcUInt32 flags; + SilcMessageFlags flags; int ret = 0; char *msg2, *tmp; gboolean found = FALSE;
--- a/libpurple/protocols/silc/silc.c Tue Feb 26 21:59:46 2013 -0500 +++ b/libpurple/protocols/silc/silc.c Sun Mar 03 18:35:43 2013 -0500 @@ -1388,8 +1388,7 @@ /* Check for images */ if (im->gflags & PURPLE_MESSAGE_IMAGES) { - list = silcpurple_image_message(im->message, - (SilcUInt32 *)(void *)&im->flags); + list = silcpurple_image_message(im->message, &im->flags); if (list) { /* Send one or more MIME message. If more than one, they are MIME fragments due to over large message */ @@ -1438,7 +1437,7 @@ SilcClientConnection conn = sg->conn; SilcDList clients; SilcClientEntry client_entry; - SilcUInt32 mflags; + SilcMessageFlags mflags; char *msg, *tmp; int ret = 0; gboolean sign = purple_account_get_bool(sg->account, "sign-verify", FALSE); @@ -1799,7 +1798,7 @@ } silcargs = g_strjoinv(" ", args); - silccmd = g_strconcat(cmd, " ", args ? silcargs : NULL, NULL); + silccmd = g_strconcat(cmd, " ", silcargs, NULL); g_free(silcargs); if (!silc_client_command_call(sg->client, sg->conn, silccmd)) { g_free(silccmd);
--- a/libpurple/protocols/silc/silcpurple.h Tue Feb 26 21:59:46 2013 -0500 +++ b/libpurple/protocols/silc/silcpurple.h Sun Mar 03 18:35:43 2013 -0500 @@ -153,7 +153,7 @@ char **tzstr, char **geostr); void silcpurple_buddy_set_icon(PurpleConnection *gc, PurpleStoredImage *img); char *silcpurple_file2mime(const char *filename); -SilcDList silcpurple_image_message(const char *msg, SilcUInt32 *mflags); +SilcDList silcpurple_image_message(const char *msg, SilcMessageFlags *mflags); #ifdef _WIN32 typedef int uid_t;
--- a/libpurple/protocols/silc/util.c Tue Feb 26 21:59:46 2013 -0500 +++ b/libpurple/protocols/silc/util.c Sun Mar 03 18:35:43 2013 -0500 @@ -653,7 +653,7 @@ there are multiple images and/or text with images multipart MIME message is created. */ -SilcDList silcpurple_image_message(const char *msg, SilcUInt32 *mflags) +SilcDList silcpurple_image_message(const char *msg, SilcMessageFlags *mflags) { SilcMime mime = NULL, p; SilcDList list, parts = NULL;
--- a/libpurple/protocols/yahoo/libymsg.c Tue Feb 26 21:59:46 2013 -0500 +++ b/libpurple/protocols/yahoo/libymsg.c Sun Mar 03 18:35:43 2013 -0500 @@ -1127,12 +1127,9 @@ m = m2; purple_util_chrreplace(m, '\r', '\n'); if (!strcmp(m, "<ding>")) { - PurpleConversation *conv = NULL; char *username; username = g_markup_escape_text(im->fed_from, -1); - conv = purple_find_conversation_with_account(PURPLE_CONV_TYPE_ANY, - username, account); purple_prpl_got_attention(gc, username, YAHOO_BUZZ); g_free(username); g_free(m);
--- a/libpurple/util.c Tue Feb 26 21:59:46 2013 -0500 +++ b/libpurple/util.c Sun Mar 03 18:35:43 2013 -0500 @@ -3925,7 +3925,8 @@ if (f <= 1) *path = '\0'; - sscanf(port_str, "%d", &port); + if (sscanf(port_str, "%d", &port) != 1) + purple_debug_error("util", "Error parsing URL port from %s\n", url); if (ret_host != NULL) *ret_host = g_strdup(host); if (ret_port != NULL) *ret_port = port; @@ -4251,7 +4252,7 @@ } #define utf8_first(x) ((x & 0x80) == 0 || (x & 0xe0) == 0xc0 \ - || (x & 0xf0) == 0xe0 || (x & 0xf8) == 0xf) + || (x & 0xf0) == 0xe0 || (x & 0xf8) == 0xf0) gchar * purple_utf8_salvage(const char *str) {
--- a/pidgin/gtkimhtml.c Tue Feb 26 21:59:46 2013 -0500 +++ b/pidgin/gtkimhtml.c Sun Mar 03 18:35:43 2013 -0500 @@ -2444,7 +2444,7 @@ if (len) *len = close - string + 1; if (tag) - *tag = g_strndup(string, *len - 1); + *tag = g_strndup(string, close - string); return TRUE; }
--- a/po/de.po Tue Feb 26 21:59:46 2013 -0500 +++ b/po/de.po Sun Mar 03 18:35:43 2013 -0500 @@ -11,8 +11,8 @@ msgstr "" "Project-Id-Version: de\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-02-20 23:46+0100\n" -"PO-Revision-Date: 2013-02-20 23:45+0100\n" +"POT-Creation-Date: 2013-02-27 12:00+0100\n" +"PO-Revision-Date: 2013-02-27 11:58+0100\n" "Last-Translator: Jochen Kemnade <jochenkemnade@web.de>\n" "Language-Team: German <de@li.org>\n" "Language: de\n" @@ -4638,6 +4638,12 @@ "online" #, c-format +msgid "Unable to initiate media with %s: resource is not online" +msgstr "" +"Medien-Sitzung mit %s konnte nicht gestartet werden: Ressource ist nicht " +"online" + +#, c-format msgid "Unable to initiate media with %s: not subscribed to user presence" msgstr "" "Medien-Sitzung mit %s konnte nicht gestartet werden: Anwesenheit des "