Error with gcry_mpi_release with opaque value.

Stef Bon stefbon at gmail.com
Sun Jun 24 10:53:13 CEST 2018


Hi,

I'm using gcry_mpi_set_opaque to store an mpoint in mpi.
When freeing this mpi with gcry_mpi_release my program crashes without
any logmessage in syslog. (normally I see segfault with error). So
serious error.

I use gcry_mpi_set_opaque like:

buffer=malloc(len);
if (buffer) {
 memcpy(buffer, from somewhere, size);
 mp->lib.mpi=gcry_mpi_set_opaque(NULL, (void *) buffer, (8 * len));
}

And releasing this with gcry_mpi_release program crashes.

What's happening?

Stef



More information about the Gcrypt-devel mailing list