Author: cazfi
Date: Sat Dec 20 21:17:07 2014
New Revision: 27367

URL: http://svn.gna.org/viewcvs/freeciv?rev=27367&view=rev
Log:
Fixed server crash when ruleset provides no name in base or road section.

See bug #23078

Modified:
    trunk/common/extras.c

Modified: trunk/common/extras.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/common/extras.c?rev=27367&r1=27366&r2=27367&view=diff
==============================================================================
--- trunk/common/extras.c       (original)
+++ trunk/common/extras.c       Sat Dec 20 21:17:07 2014
@@ -186,7 +186,13 @@
 **************************************************************************/
 struct extra_type *extra_type_by_rule_name(const char *name)
 {
-  const char *qs = Qn_(name);
+  const char *qs;
+
+  if (name == NULL) {
+    return NULL;
+  }
+
+  qs = Qn_(name);
 
   extra_type_iterate(pextra) {
     if (!fc_strcasecmp(extra_rule_name(pextra), qs)) {


_______________________________________________
Freeciv-commits mailing list
Freeciv-commits@gna.org
https://mail.gna.org/listinfo/freeciv-commits

Reply via email to