Willy, On 6/8/21 11:26 AM, Willy Tarreau wrote:
I couldn't figure how the VTC was OK but not testing it by hand. I finally found it, the outlen variable was not initialized, it should contain the size of the allocated area for the output, so if there was some dirt in the stack, it would use that and be happy, but when run by hand it had zero, hence the message above :-)
Good catch, thanks! This mistake was part of my initial patch. I'll note that I should read the function documentation more carefully.
Reproducing the issue locally it appears that the variable always contains a Unix timestamp for me.
However I'm surprised that valgrind does not detect the issue. Usually it's able to detect the use of uninitialized memory within a conditional expression.
Anyway: Thanks for fixing the issue and taking the series. I've marked the GitHub issue as fixed and closed it.
Best regards Tim Düsterhus