This is an archive of the discontinued LLVM Phabricator instance.

[msan] Support %ms in scanf.
ClosedPublic

Authored by eugenis on Aug 5 2020, 12:44 PM.

Diff Detail

Event Timeline

eugenis created this revision.Aug 5 2020, 12:44 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 5 2020, 12:44 PM
Herald added a subscriber: Restricted Project. · View Herald Transcript
eugenis requested review of this revision.Aug 5 2020, 12:44 PM

LGTM. Does this support the a format specifier as well, or just m?

guiand accepted this revision.Aug 5 2020, 12:55 PM
This revision is now accepted and ready to land.Aug 5 2020, 12:55 PM

The problem with "a" is that we do not always know what it means exactly (could be a float), and it's dangerous to dereference the pointer.

vitalybuka accepted this revision.Aug 6 2020, 1:42 PM
vitalybuka added inline comments.
compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors_format.inc
346–349

for consistency, we use real for similar stuff in other interceptors and without temp var

eugenis added inline comments.Aug 6 2020, 1:56 PM
compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors_format.inc
346–349

This file uses internal_strlen everywhere. I've got rid of the temp variable.

This revision was landed with ongoing or failed builds.Aug 6 2020, 2:50 PM
This revision was automatically updated to reflect the committed changes.