[RTS] Harden against buffer overflow
ClosedPublic

Authored by niteria on Sep 11 2017, 8:43 AM.

Details

Summary

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

Diff Detail

Repository
rGHC Glasgow Haskell Compiler
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
niteria created this revision.Sep 11 2017, 8:43 AM
bgamari accepted this revision.Sep 11 2017, 10:34 AM
This revision is now accepted and ready to land.Sep 11 2017, 10:34 AM
This revision was automatically updated to reflect the committed changes.