comparison mcabber/src/jabglue.c @ 1344:44ff580ee388

Fix a potential segfault in display_server_error() Can happen with internal-server-error's for example...
author Mikael Berthe <mikael@lilotux.net>
date Thu, 08 Nov 2007 23:46:18 +0100
parents 8a05feb23c5a
children 07816313073b
comparison
equal deleted inserted replaced
1343:8a05feb23c5a 1344:44ff580ee388
1853 if (s && *s) desc = s; 1853 if (s && *s) desc = s;
1854 1854
1855 // And sometimes there is a text message 1855 // And sometimes there is a text message
1856 s = xmlnode_get_tag_data(x, "text"); 1856 s = xmlnode_get_tag_data(x, "text");
1857 if (s && *s) desc = s; 1857 if (s && *s) desc = s;
1858
1859 // If we still have no description, let's give up
1860 if (!desc)
1861 return;
1858 1862
1859 // Strip trailing newlines 1863 // Strip trailing newlines
1860 sdesc = g_strdup(desc); 1864 sdesc = g_strdup(desc);
1861 for (s = sdesc; *s; s++) ; 1865 for (s = sdesc; *s; s++) ;
1862 if (s > sdesc) 1866 if (s > sdesc)