Issue |
130185
|
Summary |
Can Len - 1 in HeaderMapImpl::getString overflow?
|
Labels |
question
|
Assignees |
|
Reporter |
shafik
|
A static analysis tool flags `Len - 1` for possible overflow if `Len` has the value `0`:
https://github.com/llvm/llvm-project/blob/27c788de759472316169795fa06d592221ac602e/clang/lib/Lex/HeaderMap.cpp#L161
A naive reading of the code does seem to indeed lead one to believe that `MaxLen` and `Len` could both be zero. I can't really convince myself this can't happen but maybe there is a constraint I am missing that prevents this.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs