When you declare
size_t outputLength;
you are not initializing it. The analyzer does not know that NewBase64Encode
will set its value, so it's warning you that something might go wrong.
If you are absolutely 100% sure that the value will be initialized later on, then you can safely ignore the analyzer warning, but this is rarely the case. For instance, NewBase64Encode
might fail and outputLength
will result uninitialized, leading to undefined behavior.
Is always a good practice to initialize every variable you declare, so in the specific case just do
size_t outputLength = 0;
The analyzer will be happy and your code safer.