/soc/2012/michael/android: 57d1a99f065b: Merged changes from main.

Michael Zangl michael at soc.pidgin.im
Tue Jul 17 16:37:45 EDT 2012


Changeset: 57d1a99f065b6bac47c012a0f14336dc13185c42
Author:	 Michael Zangl <michael at soc.pidgin.im>
Date:	 2012-07-17 17:24 +0200
Branch:	 default
URL: http://hg.pidgin.im/soc/2012/michael/android/rev/57d1a99f065b

Description:

Merged changes from main.

diffstat:

 .hgtags                           |      2 +
 .tx/config                        |      3 +-
 ChangeLog                         |     16 +-
 ChangeLog.API                     |      3 +
 Makefile.am                       |     23 +-
 libpurple/blist.c                 |      3 +
 libpurple/protocols/msn/oim.c     |      2 +-
 libpurple/protocols/mxit/markup.c |      7 +-
 libpurple/prpl.h                  |     17 +-
 libpurple/util.c                  |     28 +-
 libpurple/util.h                  |     11 +
 pidgin/gtkaccount.c               |     80 +-
 pidgin/gtkblist.c                 |     30 +-
 pidgin/gtkconv.c                  |     36 +-
 pidgin/gtkconvwin.h               |     18 +-
 pidgin/gtkdialogs.c               |     37 +-
 pidgin/gtkrequest.c               |      7 +
 pidgin/gtkwebview.c               |     17 +
 pidgin/gtkwebview.h               |     11 +
 pidgin/plugins/xmppconsole.c      |     17 +-
 po/ChangeLog                      |      9 +-
 po/my_MM.po                       |  16571 +++++++++++++----------------------
 po/nn.po                          |    545 +-
 23 files changed, 6612 insertions(+), 10881 deletions(-)

diffs (truncated from 26594 to 300 lines):

diff --git a/.hgtags b/.hgtags
--- a/.hgtags
+++ b/.hgtags
@@ -84,3 +84,5 @@
 fbe2ce8d288fe7e2ab4bf180a537664ef7f8e907 v2.10.2
 dab0253fe3754ffd68e070cdfbbf31cd79f9a421 v2.10.3
 1d00b9e4aa6add6dca97cca4ac614d63bd105dfd v2.10.4
+a3d157700972b48cf0a23b300261a5ab0c6e165b v2.10.5
+4992bd90d8ad78ebdd324dd90d3e9d443f7dd002 v2.10.6
diff --git a/.tx/config b/.tx/config
--- a/.tx/config
+++ b/.tx/config
@@ -1,8 +1,7 @@
 [main]
-host = https://www.transifex.net
+host = https://www.transifex.com
 
 [pidgin.pidgin]
 file_filter = po/<lang>.po
 source_file = po/pidgin.pot
 source_lang = en
-
diff --git a/ChangeLog b/ChangeLog
--- a/ChangeLog
+++ b/ChangeLog
@@ -47,7 +47,12 @@
 	* The Offline Message Emulation plugin now adds a note that the message
 	  was an offline message. (Flavius Anton) (#2497)
 
-version 2.10.5:
+version 2.10.6 (07/06/2012):
+	Pidgin:
+	* Fix a bug that requires a triple-click to open a conversation
+	  window from the buddy list. (#15199)
+
+version 2.10.5 (07/05/2012):
 	libpurple:
 	* Add support for GNOME3 proxy settings. (Mihai Serban) (#15054)
 
@@ -55,6 +60,15 @@
 	* Fix a crash that may occur when trying to ignore a user who is
 	  not in the current chat room. (#15139)
 
+	MSN:
+	* Fix building with MSVC on Windows (broken in 2.10.4). (Florian
+	  Quèze)
+
+	MXit:
+	* Fix a buffer overflow vulnerability when parsing incoming messages
+	  containing inline images.  Thanks to Ulf Härnhammar for reporting
+	  this! (CVE-2012-3374)
+
 version 2.10.4 (05/06/2012):
 	General:
 	* Support building against Farstream in addition to Farsight.
diff --git a/ChangeLog.API b/ChangeLog.API
--- a/ChangeLog.API
+++ b/ChangeLog.API
@@ -247,6 +247,9 @@
 		* xmlnode_set_attrib_with_namespace
 		* xmlnode_set_attrib_with_prefix
 
+version 2.10.6:
+	* No changes
+
 version 2.10.5:
 	* No changes
 
diff --git a/Makefile.am b/Makefile.am
--- a/Makefile.am
+++ b/Makefile.am
@@ -32,35 +32,36 @@
 
 commit-check:
 	(cd po ; intltool-update -m 2>&1 | grep -v '^mismatched quotes.*\.py$$' | sed "s|current directory|po directory|" | grep . ; if [ $$? = 0 ] ; then exit 1 ; else exit 0 ; fi)
+
+# Ensure these files are sorted and contain no duplicates:
 	LC_ALL=C sort -c -t/ -u po/POTFILES.in
 	LC_ALL=C sort -c -t/ -u po/POTFILES.skip
+
+# Ensure COPYRIGHT is 100% UTF-8
 	iconv -f utf8 -t utf8 COPYRIGHT | cmp COPYRIGHT -
 
-version-check: commit-check
-# We don't want to release development versions.
+version-check:
+# Ensure our version string does not contain "dev"
 	test x`echo $(PACKAGE_VERSION) | grep dev` = x
 
-# When doing a new minor (or major) release (X.Y.0), there must be a section in
-# ChangeLog.API.
-	echo $(PACKAGE_VERSION) | grep -v "^[0-9]\+\.[0-9]\+\.0$$" >/dev/null || head ChangeLog.API | grep "^version $(PACKAGE_VERSION) (`date +%m/%d/%Y`):$$" >/dev/null
-
-# For all releases, check the ChangeLogs.
-	head ChangeLog | grep "^version $(PACKAGE_VERSION) (`date +%m/%d/%Y`):$$" >/dev/null
-	head po/ChangeLog | grep "^version $(PACKAGE_VERSION)$$" >/dev/null
+# Ensure ChangeLogs have the correct version
+	head ChangeLog     | grep "^version $(PACKAGE_VERSION) (.*):$$" >/dev/null
+	head ChangeLog.API | grep "^version $(PACKAGE_VERSION):$$" >/dev/null
+	head po/ChangeLog  | grep "^version $(PACKAGE_VERSION)$$" >/dev/null
 
 # Ensure we're working from a tag...
 	test x`hg log -r "tag($(PACKAGE_VERSION))" --template "{node}"` = x`hg id -i --debug`
 # ... and have no changes in the working copy. (this isn't really necessary with hg because hg id appends a "+")
 	test "x`hg st -mard`" = x
 
-release: version-check distcheck packages
-
 packages:
 	gpg -ab pidgin-$(PACKAGE_VERSION).tar.gz
 	gpg -ab pidgin-$(PACKAGE_VERSION).tar.bz2
 	gpg --verify pidgin-$(PACKAGE_VERSION).tar.gz.asc pidgin-$(PACKAGE_VERSION).tar.gz
 	gpg --verify pidgin-$(PACKAGE_VERSION).tar.bz2.asc pidgin-$(PACKAGE_VERSION).tar.bz2
 
+release: commit-check version-check distcheck packages
+
 if INSTALL_I18N
 PO_DIR=po
 DESKTOP_FILE=pidgin.desktop
diff --git a/libpurple/blist.c b/libpurple/blist.c
--- a/libpurple/blist.c
+++ b/libpurple/blist.c
@@ -2070,11 +2070,13 @@
 {
 	PurpleBlistUiOps *ops = purple_blist_get_ui_ops();
 	PurpleBlistNode *node, *gnode;
+	PurpleGroup *group;
 
 	g_return_if_fail(contact != NULL);
 
 	node = (PurpleBlistNode *)contact;
 	gnode = node->parent;
+	group = PURPLE_GROUP(gnode);
 
 	if (node->child) {
 		/*
@@ -2099,6 +2101,7 @@
 			node->prev->next = node->next;
 		if (node->next)
 			node->next->prev = node->prev;
+		group->totalsize--;
 
 		/* Update the UI */
 		if (ops && ops->remove)
diff --git a/libpurple/protocols/msn/oim.c b/libpurple/protocols/msn/oim.c
--- a/libpurple/protocols/msn/oim.c
+++ b/libpurple/protocols/msn/oim.c
@@ -660,7 +660,7 @@
 		charset = msn_message_get_charset(message);
 	}
 
-	if (charset && !((strncasecmp(charset, "UTF-8", 5) == 0) || (strncasecmp(charset, "UTF8", 4) == 0))) {
+	if (charset && !((g_ascii_strncasecmp(charset, "UTF-8", 5) == 0) || (g_ascii_strncasecmp(charset, "UTF8", 4) == 0))) {
 		clean_msg = g_convert(decode_msg, body_len, "UTF-8", charset, NULL, NULL, NULL);
 
 		if (!clean_msg) {
diff --git a/libpurple/protocols/mxit/markup.c b/libpurple/protocols/mxit/markup.c
--- a/libpurple/protocols/mxit/markup.c
+++ b/libpurple/protocols/mxit/markup.c
@@ -371,7 +371,7 @@
 	int					start;
 	unsigned int		end;
 	int					emo_ofs;
-	char				ii[128];
+	char*				ii;
 	char				tag[64];
 	int*				img_id;
 
@@ -389,8 +389,7 @@
 			if ( end == mx->msg->len )			/* end of emoticon tag not found */
 				break;
 
-			memset( ii, 0x00, sizeof( ii ) );
-			memcpy( ii, &mx->msg->str[emo_ofs], end - emo_ofs );
+			ii = g_strndup(&mx->msg->str[emo_ofs], end - emo_ofs);
 
 			/* remove inline image tag */
 			g_string_erase( mx->msg, start, ( end - start ) + 1 );
@@ -408,6 +407,8 @@
 				            *img_id );
 				g_string_insert( mx->msg, start, tag );
 			}
+
+			g_free(ii);
 		}
 	}
 
diff --git a/libpurple/prpl.h b/libpurple/prpl.h
--- a/libpurple/prpl.h
+++ b/libpurple/prpl.h
@@ -467,11 +467,20 @@
 	void (*convo_closed)(PurpleConnection *, const char *who);
 
 	/**
-	 *  Convert the username @a who to its canonical form.  (For example,
-	 *  AIM treats "fOo BaR" and "foobar" as the same user; this function
-	 *  should return the same normalized string for both of those.)
+	 * Convert the username @a who to its canonical form. Also checks for
+	 * validity.
+	 *
+	 * For example, AIM treats "fOo BaR" and "foobar" as the same user; this
+	 * function should return the same normalized string for both of those.
+	 * On the other hand, both of these are invalid for protocols with
+	 * number-based usernames, so function should return NULL in such case.
+	 *
+	 * @param account  The account, that username is related with. Can
+	 *                 be NULL.
+	 * @param who      The username to convert.
+	 * @return         Normalized username, or NULL, if it's invalid.
 	 */
-	const char *(*normalize)(const PurpleAccount *, const char *who);
+	const char *(*normalize)(const PurpleAccount *account, const char *who);
 
 	/**
 	 * Set the buddy icon for the given connection to @a img.  The prpl
diff --git a/libpurple/util.c b/libpurple/util.c
--- a/libpurple/util.c
+++ b/libpurple/util.c
@@ -3487,6 +3487,28 @@
 	return buf;
 }
 
+gboolean
+purple_validate(const PurplePlugin *prpl, const char *str)
+{
+	PurplePluginProtocolInfo *prpl_info;
+	const char *normalized;
+	
+	g_return_val_if_fail(prpl != NULL, FALSE);
+	g_return_val_if_fail(str != NULL, FALSE);
+	
+	if (str[0] == '\0')
+		return FALSE;
+	
+	prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl);
+	
+	if (!prpl_info->normalize)
+		return TRUE;
+	
+	normalized = prpl_info->normalize(NULL, str);
+	
+	return (NULL != normalized);
+}
+
 gchar *
 purple_strdup_withhtml(const gchar *src)
 {
@@ -3896,9 +3918,9 @@
 
 #define ADDR_CTRL "A-Za-z0-9.-"
 #define PORT_CTRL "0-9"
-#define PAGE_CTRL "A-Za-z0-9.~_/:*!@&%%?=+^-"
-#define USER_CTRL "A-Za-z0-9.~_/*!&%%?=+^-"
-#define PASSWD_CTRL "A-Za-z0-9.~_/*!&%%?=+^-"
+#define PAGE_CTRL "A-Za-z0-9.,~_/:*!@&%%?=+^-"
+#define USER_CTRL "A-Za-z0-9.,~_/*!&%%?=+^-"
+#define PASSWD_CTRL "A-Za-z0-9.,~_/*!&%%?=+^-"
 
 	g_return_val_if_fail(url != NULL, FALSE);
 
diff --git a/libpurple/util.h b/libpurple/util.h
--- a/libpurple/util.h
+++ b/libpurple/util.h
@@ -56,6 +56,7 @@
 #include "signals.h"
 #include "xmlnode.h"
 #include "notify.h"
+#include "plugin.h"
 
 
 typedef char *(*PurpleInfoFieldFormatCallback)(const char *field, size_t len);
@@ -960,6 +961,16 @@
 const char *purple_normalize_nocase(const PurpleAccount *account, const char *str);
 
 /**
+ * Checks, if a string is valid.
+ *
+ * @param prpl     The protocol plugin the string belongs to.
+ * @param str      The string to validate.
+ *
+ * @return TRUE, if string is valid, otherwise FALSE.
+ */
+gboolean purple_validate(const PurplePlugin *prpl, const char *str);
+
+/**
  * Compares two strings to see if the first contains the second as
  * a proper prefix.
  *
diff --git a/pidgin/gtkaccount.c b/pidgin/gtkaccount.c
--- a/pidgin/gtkaccount.c
+++ b/pidgin/gtkaccount.c
@@ -248,12 +248,16 @@
 	gtk_widget_grab_focus(dialog->protocol_menu);
 
 	if (!dialog->prpl_info || !dialog->prpl_info->register_user) {
+		gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(
+			dialog->register_button), FALSE);
 		gtk_widget_hide(dialog->register_button);
 	} else {
 		if (dialog->prpl_info != NULL &&



More information about the Commits mailing list