diff libpurple/util.c @ 25742:7d2f51772351

propagate from branch 'im.pidgin.pidgin' (head f3891f3348abfe90fbe60a054833c12075aa8df4) to branch 'im.pidgin.cpw.malu.xmpp.ibb_ft' (head 7d2a1f83af262aa02ba610c7c79e68089a32106c)
author Marcus Lundblad <ml@update.uu.se>
date Sun, 16 Nov 2008 15:39:55 +0000
parents f9503aa61fb4
children 104f6f755c7e b5385e13e32e
line wrap: on
line diff
--- a/libpurple/util.c	Thu Nov 13 19:50:53 2008 +0000
+++ b/libpurple/util.c	Sun Nov 16 15:39:55 2008 +0000
@@ -984,6 +984,8 @@
 	gchar *tmp;
 	gchar *ret;
 
+	g_return_val_if_fail(opt != NULL, NULL);
+
 	if (!css_str)
 		return NULL;
 
@@ -2390,6 +2392,7 @@
 	gunichar c;
 	char *tag;
 
+	g_return_val_if_fail(str != NULL, NULL);
 	g_return_val_if_fail(x <= y, NULL);
 
 	if (x == y)
@@ -3440,6 +3443,9 @@
 	char *cmd;
 	GHashTable *params = NULL;
 	int len;
+
+	g_return_if_fail(uri != NULL);
+
 	if (!(tmp = strchr(uri, ':')) || tmp == uri) {
 		purple_debug_error("util", "Malformed protocol handler message - missing protocol.\n");
 		return;
@@ -4145,6 +4151,8 @@
 	const char *c, *domain;
 	static char *rfc822_specials = "()<>@,;:\\\"[]";
 
+	g_return_val_if_fail(address != NULL, FALSE);
+
 	/* first we validate the name portion (name@domain) (rfc822)*/
 	for (c = address;  *c;  c++) {
 		if (*c == '\"' && (c == address || *(c - 1) == '.' || *(c - 1) == '\"')) {
@@ -4193,6 +4201,9 @@
 {
 	int c, o1, o2, o3, o4;
 	char end;
+
+	g_return_val_if_fail(ip != NULL, FALSE);
+
 	c = sscanf(ip, "%d.%d.%d.%d%c", &o1, &o2, &o3, &o4, &end);
 	if (c != 4 || o1 < 0 || o1 > 255 || o2 < 0 || o2 > 255 || o3 < 0 || o3 > 255 || o4 < 0 || o4 > 255)
 		return FALSE;