Sanitize petnames and fruit to prevent escape codes
This commit is contained in:
@@ -1300,6 +1300,7 @@ boolean tinitial, tfrom_file;
|
||||
if (negated) bad_negation(fullname, FALSE);
|
||||
else if ((op = string_for_env_opt(fullname, opts, FALSE)) != 0)
|
||||
nmcpy(catname, op, PL_PSIZ);
|
||||
sanitize_name(catname);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1309,6 +1310,7 @@ boolean tinitial, tfrom_file;
|
||||
if (negated) bad_negation(fullname, FALSE);
|
||||
else if ((op = string_for_env_opt(fullname, opts, FALSE)) != 0)
|
||||
nmcpy(dogname, op, PL_PSIZ);
|
||||
sanitize_name(dogname);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1318,6 +1320,7 @@ boolean tinitial, tfrom_file;
|
||||
if (negated) bad_negation(fullname, FALSE);
|
||||
else if ((op = string_for_env_opt(fullname, opts, FALSE)) != 0)
|
||||
nmcpy(horsename, op, PL_PSIZ);
|
||||
sanitize_name(horsename);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1662,6 +1665,7 @@ boolean tinitial, tfrom_file;
|
||||
}
|
||||
goodfruit:
|
||||
nmcpy(pl_fruit, op, PL_FSIZ);
|
||||
sanitize_name(pl_fruit);
|
||||
/* OBJ_NAME(objects[SLIME_MOLD]) won't work after initialization */
|
||||
if (!*pl_fruit)
|
||||
nmcpy(pl_fruit, "slime mold", PL_FSIZ);
|
||||
|
||||
Reference in New Issue
Block a user