X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=src%2Fsptps.c;fp=src%2Fsptps.c;h=2e9ac6fe63331917c320805fdac592fea91753f7;hb=98b9d73682733072d66d6db3beb15e7309805cf5;hp=49e0a336de6a66436fb245507bb16d0ea869ac94;hpb=f3dae7d32467b2ed28c1f62bfa2f5929f2611284;p=meshlink diff --git a/src/sptps.c b/src/sptps.c index 49e0a336..2e9ac6fe 100644 --- a/src/sptps.c +++ b/src/sptps.c @@ -565,6 +565,9 @@ bool sptps_receive_data(sptps_t *s, const void *data, size_t len) { // Start a SPTPS session. bool sptps_start(sptps_t *s, void *handle, bool initiator, bool datagram, ecdsa_t *mykey, ecdsa_t *hiskey, const char *label, size_t labellen, send_data_t send_data, receive_record_t receive_record) { + if(!s || !mykey || !hiskey || !label || !labellen || !send_data || !receive_record) + return error(s, EINVAL, "Invalid argument to sptps_start()"); + // Initialise struct sptps memset(s, 0, sizeof *s);