diff options
author | Hans Wennborg <hans@hanshq.net> | 2014-04-29 19:42:27 +0000 |
---|---|---|
committer | Hans Wennborg <hans@hanshq.net> | 2014-04-29 19:42:27 +0000 |
commit | df51ee6c50f48749b738a324951dc2ed0d83333d (patch) | |
tree | 2f485a51c1db40fba3fb383ee80e66f93b677f21 /clang/lib/Analysis/ScanfFormatString.cpp | |
parent | 1a3f18b161dce9d9672b18a47e2432210b10c63e (diff) | |
download | bcm5719-llvm-df51ee6c50f48749b738a324951dc2ed0d83333d.tar.gz bcm5719-llvm-df51ee6c50f48749b738a324951dc2ed0d83333d.zip |
scanf analysis: handle scanlists that start with ^] (PR19559)
llvm-svn: 207573
Diffstat (limited to 'clang/lib/Analysis/ScanfFormatString.cpp')
-rw-r--r-- | clang/lib/Analysis/ScanfFormatString.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/lib/Analysis/ScanfFormatString.cpp b/clang/lib/Analysis/ScanfFormatString.cpp index 3ff7f0ad2e5..18505e263be 100644 --- a/clang/lib/Analysis/ScanfFormatString.cpp +++ b/clang/lib/Analysis/ScanfFormatString.cpp @@ -50,6 +50,15 @@ static bool ParseScanList(FormatStringHandler &H, } } + // Special case: "]^" are the first characters. + if (I + 1 != E && I[0] == '^' && I[1] == ']') { + I += 2; + if (I == E) { + H.HandleIncompleteScanList(start, I - 1); + return true; + } + } + // Look for a ']' character which denotes the end of the scan list. while (*I != ']') { if (++I == E) { |