This revision was automatically updated to reflect the committed changes.
Closed by commit rG1d7e58cfade1: [analyzer] Fix use of length in CStringChecker
(authored by einvbri ).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.
martong accepted this revision.
martong added a comment.
This revision is now accepted and ready to land.
LGTM
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D129269/new/
https://reviews.llvm.org/D129269
_
vabridgers updated this revision to Diff 443658.
vabridgers edited the summary of this revision.
vabridgers added a comment.
update per comments from @martong
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D129269/new/
https://reviews.llvm.org/D12926
vabridgers added a comment.
Thanks @martong , I understand. I'll make the changes and resubmit. Best!
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D129269/new/
https://reviews.llvm.org/D129269
___
cfe-co
martong added a comment.
Thanks Vince for the patch! I think the implementation is correct. But I am
worried that it might do sub-optimal computations on the string literals. I
mean, getting the length would require O(N) steps each time, and that could be
problematic with long literals, especia
vabridgers updated this revision to Diff 443101.
vabridgers added a comment.
a proposal to handle embedded null case caught by @steakhal
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D129269/new/
https://reviews.llvm.org/D129269
Files:
clang/lib/
vabridgers added a comment.
Thanks Balazs, you mean something like this correct?
void strcpy_no_overflow_2(char *y) {
char x[3];
strcpy(x, "12\0"); // this produces a warning, but should not.
}
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D1
steakhal added a comment.
Actually, there is one more bug there. If the string has an embedded
null-terminator; a wrong length will be returned.
Please add tests to demonstrate the wrong behavior. Try different target
triples for having irregular char sizes and pin that.
Repository:
rG LLVM
vabridgers created this revision.
vabridgers added reviewers: martong, steakhal.
Herald added subscribers: manas, ASDenysPetrov, dkrupp, donat.nagy, Szelethus,
mikhail.ramalho, a.sidorin, rnkovacs, szepet, baloghadamsoftware, xazax.hun.
Herald added a reviewer: NoQ.
Herald added a project: All.
va