Skip to content

Commit

Permalink
Merge pull request #239 from openziti/check-session-for-posture-check
Browse files Browse the repository at this point in the history
NULL check ztx.session
  • Loading branch information
ekoby authored Feb 25, 2021
2 parents 521c8a3 + 5dbb83c commit 8c87663
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions library/posture.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,12 @@ static void ziti_pr_free_responses(struct pr_info *info) {
}

void ziti_send_posture_data(struct ziti_ctx *ztx) {
ZITI_LOG(VERBOSE, "starting to send posture data");

if (ztx->session->id == NULL) {
ZITI_LOG(DEBUG, "no session id, aborting posture checks");
if (ztx->session == NULL || ztx->session->id == NULL) {
ZITI_LOG(DEBUG, "no session, can't submit posture checks");
return;
}

ZITI_LOG(VERBOSE, "starting to send posture data");
bool new_session_id = ztx->posture_checks->previous_session_id == NULL || strcmp(ztx->posture_checks->previous_session_id, ztx->session->id) != 0;

if(new_session_id || ztx->posture_checks->must_send_every_time) {
Expand Down

0 comments on commit 8c87663

Please sign in to comment.