Calling ARRAY_SIZE on a char* will not actually compute it's size, but just the pointer size.
A new Clang warning enables by default warns about this.
Replaced the call with internal_strnlen.
Differential D54484
[lsan] [NFC] Change ARRAY_SIZE to internal_strnlen george.karpenkov on Nov 13 2018, 11:47 AM. Authored by
Details Calling ARRAY_SIZE on a char* will not actually compute it's size, but just the pointer size. Replaced the call with internal_strnlen.
Diff Detail
Event TimelineComment Actions @fjricci Now the test is actually failing, because the size of e.g. "__objc_classlist" is 16, and kMaxSegName is also 16. I'm changing < to <=, and adding +1 to the second strnlen arguments. |