- if(token) {
- LL_FOREACH(cbList, out) {
- OC_LOG(INFO, TAG, PCF("comparing tokens"));
- OC_LOG_BUFFER(INFO, TAG, token->token, token->tokenLength);
- OC_LOG_BUFFER(INFO, TAG, out->token.token, out->token.tokenLength);
- if((out->token.tokenLength == token->tokenLength) &&
- (memcmp(out->token.token, token->token, token->tokenLength) == 0) ) {
+
+ if(token && *token && tokenLength <= CA_MAX_TOKEN_LEN && tokenLength > 0)
+ {
+ OC_LOG (INFO, TAG, "Looking for token");
+ OC_LOG_BUFFER(INFO, TAG, (const uint8_t *)token, tokenLength);
+ OC_LOG(INFO, TAG, "\tFound in callback list");
+ LL_FOREACH(cbList, out)
+ {
+ OC_LOG_BUFFER(INFO, TAG, (const uint8_t *)out->token, tokenLength);
+
+ if(memcmp(out->token, token, tokenLength) == 0)
+ {