summaryrefslogtreecommitdiff
path: root/lib/gnutls_mpi.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gnutls_mpi.c')
-rw-r--r--lib/gnutls_mpi.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/gnutls_mpi.c b/lib/gnutls_mpi.c
index 337f396c94..8dede95446 100644
--- a/lib/gnutls_mpi.c
+++ b/lib/gnutls_mpi.c
@@ -75,6 +75,8 @@ int _gnutls_mpi_print( void *buffer, size_t *nbytes, const GNUTLS_MPI a )
{
int ret;
+ if (nbytes == NULL || a == NULL) return GNUTLS_E_INVALID_REQUEST;
+
ret = gcry_mpi_print( GCRYMPI_FMT_USG, buffer, *nbytes, nbytes, a);
if (!ret) return ret;
@@ -86,6 +88,8 @@ int _gnutls_mpi_print_lz( void *buffer, size_t *nbytes, const GNUTLS_MPI a )
{
int ret;
+ if (nbytes == NULL || a == NULL) return GNUTLS_E_INVALID_REQUEST;
+
ret = gcry_mpi_print( GCRYMPI_FMT_STD, buffer, *nbytes, nbytes, a);
if (!ret) return ret;