#include "postgres.h"
#include "px.h"
+#include "utils/memdebug.h"
/* how many bytes to ask from system random provider */
#define RND_BYTES 32
memcpy(dst, (uint8 *) &x, sizeof(x));
dst += sizeof(x);
- /* let's be desperate */
+ /* hash of uninitialized stack and heap allocations */
res = px_find_digest("sha1", &md);
if (res >= 0)
{
uint8 stack[8192];
int alloc = 32 * 1024;
+ VALGRIND_MAKE_MEM_DEFINED(stack, sizeof(stack));
px_md_update(md, stack, sizeof(stack));
ptr = px_alloc(alloc);
+ VALGRIND_MAKE_MEM_DEFINED(ptr, alloc);
px_md_update(md, ptr, alloc);
px_free(ptr);