[clang] Fix crash when parsing scanf format string with missing arguments
authorserge-sans-paille <sguelton@redhat.com>
Fri, 2 Sep 2022 11:36:08 +0000 (13:36 +0200)
committerserge-sans-paille <sguelton@redhat.com>
Mon, 5 Sep 2022 08:54:18 +0000 (10:54 +0200)
commitab09043a1985bfb9f1e4393a29a9d83326d306fe
tree59322e849c9cf9083ef02b37a9c86caecddd91bb
parent69778121e4a66856985bfc2ff875a864b41ee592
[clang] Fix crash when parsing scanf format string with missing arguments

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

Differential Revision: https://reviews.llvm.org/D133197
clang/lib/Sema/SemaChecking.cpp
clang/test/Sema/format-strings-scanf.c