This is an archive of the discontinued LLVM Phabricator instance.

[libc][obvious] fix printf failing to stop on %\0
ClosedPublic

Authored by michaelrj on Nov 3 2022, 3:28 PM.

Details

Summary

Previously, the printf parser would treat "%\0" as a conversion with the
name "\0", and advance past the null byte causing a buffer overflow.
This patch corrects that in both printf and scanf.

Diff Detail

Event Timeline

michaelrj created this revision.Nov 3 2022, 3:28 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptNov 3 2022, 3:28 PM
michaelrj requested review of this revision.Nov 3 2022, 3:28 PM
sivachandra accepted this revision.Nov 6 2022, 11:36 PM
This revision is now accepted and ready to land.Nov 6 2022, 11:36 PM
This revision was automatically updated to reflect the committed changes.