Skip to content

Commit

Permalink
fix crash bug when someone sends a setup session packet with a specif…
Browse files Browse the repository at this point in the history
…ied handle
  • Loading branch information
cjdelisle committed Mar 19, 2017
1 parent 1bf455c commit 0e818de
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions net/SessionManager.c
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,12 @@ static Iface_DEFUN incomingFromSwitchIf(struct Message* msg, struct Iface* iface
return NULL;
}
Message_shift(msg, -4, NULL);
uint32_t nonce = Endian_bigEndianToHost32(((uint32_t*)msg->bytes)[0]);
if (nonce < 4) {
Log_debug(sm->log, "DROP setup message [%u] with specified handle [%u]",
nonce, nonceOrHandle);
return NULL;
}
} else {
// handle + big cryptoauth header
if (msg->length < CryptoHeader_SIZE + 4) {
Expand Down

0 comments on commit 0e818de

Please sign in to comment.