This is an archive of the discontinued LLVM Phabricator instance.

[clang] Fix crash when parsing scanf format string with missing arguments
ClosedPublic

Authored by serge-sans-paille on Sep 2 2022, 4:41 AM.

Details

Summary

When parsing a format string with less argument than specified, one should check
argument access because there may be no such argument.

This fixes #57517

Diff Detail

Event Timeline

Herald added a project: Restricted Project. · View Herald TranscriptSep 2 2022, 4:41 AM
serge-sans-paille requested review of this revision.Sep 2 2022, 4:41 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 2 2022, 4:41 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
inclyc accepted this revision.Sep 2 2022, 6:07 AM
inclyc added a reviewer: aaron.ballman.
inclyc added a subscriber: aaron.ballman.

Thanks @serge-sans-paille! Basically LGTM. Maybe we need to backport this patch though? @aaron.ballman

This revision is now accepted and ready to land.Sep 2 2022, 6:07 AM
aaron.ballman accepted this revision.Sep 2 2022, 6:32 AM

LGTM!

Thanks @serge-sans-paille! Basically LGTM. Maybe we need to backport this patch though? @aaron.ballman

Clang 15 is closed for backports that aren't critical at this point AFAIK (we're slated to release Clang 15 in a few days). I believe this isn't fixing a recent regression, so the change should also have a release note.

MaskRay accepted this revision.Sep 2 2022, 6:00 PM