diff --git a/src/kem/kem.c b/src/kem/kem.c index a7917d5d9..5b4b5d170 100644 --- a/src/kem/kem.c +++ b/src/kem/kem.c @@ -30,6 +30,9 @@ OQS_API int OQS_KEM_alg_count() { } OQS_API OQS_KEM *OQS_KEM_new(const char *method_name) { + if (method_name == NULL) { + return NULL; + } if (0 == strcasecmp(method_name, OQS_KEM_alg_default)) { return OQS_KEM_new(OQS_KEM_DEFAULT); } else if (0 == strcasecmp(method_name, OQS_KEM_alg_bike1_l1)) { diff --git a/src/sig/sig.c b/src/sig/sig.c index 783a9bea5..3e6640734 100644 --- a/src/sig/sig.c +++ b/src/sig/sig.c @@ -33,6 +33,9 @@ OQS_API int OQS_SIG_alg_count() { } OQS_API OQS_SIG *OQS_SIG_new(const char *method_name) { + if (method_name == NULL) { + return NULL; + } if (0 == strcasecmp(method_name, OQS_SIG_alg_default)) { return OQS_SIG_new(OQS_SIG_DEFAULT); } else if (0 == strcasecmp(method_name, OQS_SIG_alg_picnic_L1_FS)) {