[PATCH] D114342: ConvertUTF, new wrapper API

Corentin Jabot via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 25 05:33:54 PST 2022


cor3ntin added inline comments.


================
Comment at: llvm/lib/Support/ConvertUTFWrapper.cpp:148
+  // Avoid OOB by returning early on empty input.
+  if (SrcBytes.empty())
+    return true;
----------------
cor3ntin wrote:
> aaron.ballman wrote:
> > Bigcheese wrote:
> > > I believe this actually needs an additional check that that `SrcBytes.size()` is `< 4` and return false.
> > Should we be testing that the input array length is a multiple of 4 as well?
> There is an assert just below, I suppose that's fine
no, that assert doesn't do that. so you are right something is missing here - and on second thought, it probably should not be an assert, just a check in that if


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D114342/new/

https://reviews.llvm.org/D114342



More information about the llvm-commits mailing list