X-Git-Url: http://git.meshlink.io/?p=meshlink;a=blobdiff_plain;f=src%2Fprotocol_misc.c;h=af3caddf8957f38006a540ddc331cfe0823efcdd;hp=dde4bbb4db377445cda34c3b6e028ebb8268237f;hb=9cde0d32cf209388cc59b06b7dcb0c3432f97da5;hpb=9e8e77dba3462c4a7f7e758ade4d16bc669fc4a7 diff --git a/src/protocol_misc.c b/src/protocol_misc.c index dde4bbb4..af3caddf 100644 --- a/src/protocol_misc.c +++ b/src/protocol_misc.c @@ -34,6 +34,9 @@ int maxoutbufsize = 0; /* Status and error notification routines */ bool status_h(meshlink_handle_t *mesh, connection_t *c, const char *request) { + assert(request); + assert(*request); + int statusno; char statusstring[MAX_STRING_SIZE]; @@ -48,6 +51,9 @@ bool status_h(meshlink_handle_t *mesh, connection_t *c, const char *request) { } bool error_h(meshlink_handle_t *mesh, connection_t *c, const char *request) { + assert(request); + assert(*request); + int err; char errorstring[MAX_STRING_SIZE]; @@ -65,6 +71,10 @@ bool termreq_h(meshlink_handle_t *mesh, connection_t *c, const char *request) { (void)mesh; (void)c; (void)request; + + assert(request); + assert(*request); + return false; } @@ -77,6 +87,10 @@ bool send_ping(meshlink_handle_t *mesh, connection_t *c) { bool ping_h(meshlink_handle_t *mesh, connection_t *c, const char *request) { (void)request; + + assert(request); + assert(*request); + return send_pong(mesh, c); } @@ -87,6 +101,10 @@ bool send_pong(meshlink_handle_t *mesh, connection_t *c) { bool pong_h(meshlink_handle_t *mesh, connection_t *c, const char *request) { (void)mesh; (void)request; + + assert(request); + assert(*request); + c->status.pinged = false; /* Successful connection, reset timeout if this is an outgoing connection. */ @@ -110,6 +128,9 @@ bool pong_h(meshlink_handle_t *mesh, connection_t *c, const char *request) { /* Sending and receiving packets via TCP */ bool tcppacket_h(meshlink_handle_t *mesh, connection_t *c, const char *request) { + assert(request); + assert(*request); + short int len; if(sscanf(request, "%*d %hd", &len) != 1) {