Fix a potential segfault in display_server_error()
authorMikael Berthe <mikael@lilotux.net>
Thu, 08 Nov 2007 23:46:18 +0100
changeset 1344 44ff580ee388
parent 1343 8a05feb23c5a
child 1345 8e4e741787be
Fix a potential segfault in display_server_error() Can happen with internal-server-error's for example...
mcabber/src/jabglue.c
--- a/mcabber/src/jabglue.c	Tue Nov 06 17:12:04 2007 +0100
+++ b/mcabber/src/jabglue.c	Thu Nov 08 23:46:18 2007 +0100
@@ -1856,6 +1856,10 @@
   s = xmlnode_get_tag_data(x, "text");
   if (s && *s) desc = s;
 
+  // If we still have no description, let's give up
+  if (!desc)
+    return;
+
   // Strip trailing newlines
   sdesc = g_strdup(desc);
   for (s = sdesc; *s; s++) ;