Skip to content

Commit 3360a79

Browse files
authored
add missing NULL checks to context->hdr (#160)
1 parent 606d6b7 commit 3360a79

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/wh_comm.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ int wh_CommClient_SendRequest(whCommClient* context, uint16_t magic,
102102
int rc = 0;
103103

104104
if ( (context == NULL) ||
105+
(context->hdr == NULL) ||
105106
(context->initialized == 0) ||
106107
(context->transport_cb == NULL) ||
107108
(context->transport_cb->Send == NULL)) {
@@ -146,6 +147,7 @@ int wh_CommClient_RecvResponse(whCommClient* context,
146147
uint16_t data_size = 0;
147148

148149
if ( (context == NULL) ||
150+
(context->hdr == NULL) ||
149151
(context->initialized == 0) ||
150152
(context->transport_cb == NULL) ||
151153
(context->transport_cb->Recv == NULL)){
@@ -257,6 +259,7 @@ int wh_CommServer_RecvRequest(whCommServer* context,
257259
uint16_t data_size = 0;
258260

259261
if ( (context == NULL) ||
262+
(context->hdr == NULL) ||
260263
(context->initialized == 0) ||
261264
(context->transport_cb == NULL) ||
262265
(context->transport_cb->Recv == NULL)) {
@@ -298,6 +301,7 @@ int wh_CommServer_SendResponse(whCommServer* context,
298301
int rc = 0;
299302

300303
if ( (context == NULL) ||
304+
(context->hdr == NULL) ||
301305
(context->initialized == 0) ||
302306
(context->transport_cb == NULL) ||
303307
(context->transport_cb->Send == NULL)){
@@ -350,4 +354,4 @@ int wh_CommServer_Cleanup(whCommServer* context)
350354
return rc;
351355
}
352356

353-
#endif /* WOLFHSM_CFG_ENABLE_SERVER */
357+
#endif /* WOLFHSM_CFG_ENABLE_SERVER */

0 commit comments

Comments
 (0)