Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Check that table[0].name is defined.
authorArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Tue, 11 Mar 2014 15:44:53 +0000 (16:44 +0100)
committerArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Tue, 11 Mar 2014 16:25:11 +0000 (17:25 +0100)
Lost bits from commit f4d034af50e34fbac8e6cf57d767f6704dfaf49c.

src/surf/surf_interface.cpp

index 0c117ab..6be998b 100644 (file)
@@ -334,7 +334,9 @@ int find_model_description(s_surf_model_description_t * table,
     if (!strcmp(name, table[i].name)) {
       return i;
     }
-  name_list = strdup(table[0].name);
+  if (!table[0].name)
+    xbt_die("No model is valid! This is a bug.");
+  name_list = xbt_strdup(table[0].name);
   for (i = 1; table[i].name; i++) {
     name_list = (char *) xbt_realloc(name_list, strlen(name_list) + strlen(table[i].name) + 3);
     strcat(name_list, ", ");