]> granicus.if.org Git - nethack/commitdiff
Sanitize petnames and fruit to prevent escape codes
authorPasi Kallinen <paxed@alt.org>
Mon, 2 Mar 2015 18:10:18 +0000 (20:10 +0200)
committerPasi Kallinen <paxed@alt.org>
Tue, 17 Mar 2015 16:47:13 +0000 (18:47 +0200)
doc/fixes35.0
src/options.c

index d3f6b1a9093c058890316100a51b7973d40d65cc..1e31bf65a85670b398da41b9d11438a702b2e46b 100644 (file)
@@ -865,6 +865,7 @@ all sources of erosion now affect objects the same way
 passive attacks no longer erode armor covered by other armor
 dipping a fooproof item into acid no longer forgets that it's fooproof
 dipping a container into uncursed water now gets its contents wet
+sanitize petnames and fruit to prevent escape codes
 
 Platform- and/or Interface-Specific Fixes
 -----------------------------------------
index 54ad99efc708d44b0d9cfc0b2eeb0a6ece644641..229c2df918fb86328b503b13481ca6fd3520b487 100644 (file)
@@ -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);