Found with clang, CFLAGS=-fsanitize=memory.
Fix GitHub issues #848 and #849.
The problem is that for some unknown reason the pt buffer is not
initialized after EVP_DecryptUpdate() call, no error, in:
print-esp.c:260: if (!EVP_DecryptUpdate(ctx, pt, &len, ct, ctlen)) {
* we can't decrypt on top of the input buffer.
*/
ptlen = ctlen;
- pt = (u_char *)malloc(ptlen);
+ pt = (u_char *)calloc(1, ptlen);
if (pt == NULL) {
EVP_CIPHER_CTX_free(ctx);
(*ndo->ndo_error)(ndo, S_ERR_ND_MEM_ALLOC,