summaryrefslogtreecommitdiff
path: root/includes/rts/Flags.h
diff options
context:
space:
mode:
authorBartosz Nitka <niteria@gmail.com>2017-09-13 08:28:00 -0400
committerBen Gamari <ben@smart-cactus.org>2017-09-13 10:40:02 -0400
commite62391a75c8dc304f902e732fc63eefb21930aca (patch)
tree6800ce6725117eae34d1514b7cf7fbf475cf1186 /includes/rts/Flags.h
parent91262e75dd1d80f8f28a3922934ec7e59290e28c (diff)
downloadhaskell-e62391a75c8dc304f902e732fc63eefb21930aca.tar.gz
[RTS] Harden against buffer overflow
This sprintf is safe thanks to the guarantees on the format strings that we pass to it. Well, almost. The GR_FILENAME_FMT_GUM format would not have satisfied them if it was still used. If someone makes a mistake that's a potential privilege escalation, so I think it's reasonable to switch to snprintf to protect against that remote possibility. Test Plan: it builds, CI Reviewers: simonmar, bgamari, austin, erikd Reviewed By: bgamari Subscribers: rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D3944
Diffstat (limited to 'includes/rts/Flags.h')
-rw-r--r--includes/rts/Flags.h1
1 files changed, 0 insertions, 1 deletions
diff --git a/includes/rts/Flags.h b/includes/rts/Flags.h
index 6700f9d95f..6040201c73 100644
--- a/includes/rts/Flags.h
+++ b/includes/rts/Flags.h
@@ -263,7 +263,6 @@ extern RTS_FLAGS RtsFlags;
#define STATS_FILENAME_MAXLEN 128
#define GR_FILENAME_FMT "%0.124s.gr"
-#define GR_FILENAME_FMT_GUM "%0.120s.%03d.%s"
#define HP_FILENAME_FMT "%0.124s.hp"
#define LIFE_FILENAME_FMT "%0.122s.life"
#define PROF_FILENAME_FMT "%0.122s.prof"