If you let untrusted input reach inlen and overflow that computation, you have already failed:
The caller shouldn't be responsible for enforcing preconditions of your function. They should just provide the input buffer, output buffer, their sizes and your implementation should verify whether it's safe to proceed.