snprintf returns buffer size needed for printing. If buffer was small, calling
code receives incorrectly symbolized buffer and fail.
Details
Details
Diff Detail
Diff Detail
- Build Status
Buildable 3538 Build 3538: arc lint + arc unit
Event Timeline
lib/sanitizer_common/sanitizer_symbolizer_libcdep.cc | ||
---|---|---|
361 | I think it should be >=. Writes at most "length" symbols to "buffer" (including trailing '\0'). | |
lib/sanitizer_common/symbolizer/sanitizer_symbolize.cc | ||
45 | I think it should be <. |
test/sanitizer_common/TestCases/symbolize_stack.cc | ||
---|---|---|
2 | add a comment that you are testing symbolization of very long function names |
I think it should be >=.
Writes at most "length" symbols to "buffer" (including trailing '\0').
Returns the number of symbols that should have been written to buffer
(not including trailing '\0'). Thus, the string is truncated
iff return value is not less than "length".