Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

null check data_cb before calling #819

Merged
merged 2 commits into from
Feb 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion library/bind.c
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ static void get_service_cb(ziti_context ztx, const ziti_service *service, int st
struct ziti_conn *conn = ctx;

if (status == ZITI_SERVICE_UNAVAILABLE) {
CONN_LOG(WARN, "service[%s] is not available", service->name);
CONN_LOG(WARN, "service[%s] is not available", conn->service);
notify_status(conn, ZITI_SERVICE_UNAVAILABLE);
return;
}
Expand Down
2 changes: 1 addition & 1 deletion library/connect.c
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@
if (r->cb != NULL) {
r->cb(conn, status ? status : (ssize_t) r->len, r->ctx);
}
r = model_list_it_element(it);

Check warning on line 255 in library/connect.c

View workflow job for this annotation

GitHub Actions / Linux ARM64

assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]

Check warning on line 255 in library/connect.c

View workflow job for this annotation

GitHub Actions / MacOS arm64

assigning to 'struct ziti_write_req_s *' from 'const void *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]

Check warning on line 255 in library/connect.c

View workflow job for this annotation

GitHub Actions / Linux x86_64

assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]

Check warning on line 255 in library/connect.c

View workflow job for this annotation

GitHub Actions / MacOS x86_64

assigning to 'struct ziti_write_req_s *' from 'const void *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
it = model_list_it_next(it);
} while(r);
model_list_clear(&req->chain, free);
Expand Down Expand Up @@ -664,7 +664,7 @@
count++;
tot += r->len;

r = model_list_it_element(it);

Check warning on line 667 in library/connect.c

View workflow job for this annotation

GitHub Actions / Linux ARM64

assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]

Check warning on line 667 in library/connect.c

View workflow job for this annotation

GitHub Actions / MacOS arm64

assigning to 'struct ziti_write_req_s *' from 'const void *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]

Check warning on line 667 in library/connect.c

View workflow job for this annotation

GitHub Actions / Linux x86_64

assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
it = model_list_it_next(it);
} while(r != NULL);
CONN_LOG(DEBUG, "consolidated %d payloads total_len[%zd]", count, tot);
Expand Down Expand Up @@ -1196,7 +1196,7 @@
}

req->waiter = ziti_channel_send_for_reply(ch, content_type, headers, nheaders,
session->token, strlen(session->token),

Check warning on line 1199 in library/connect.c

View workflow job for this annotation

GitHub Actions / MacOS arm64

passing 'model_string' (aka 'const char *') to parameter of type 'const uint8_t *' (aka 'const unsigned char *') converts between pointers to integer types where one is of the unique plain 'char' type and the other is not [-Wpointer-sign]
connect_reply_cb, conn);

return ZITI_OK;
Expand Down Expand Up @@ -1371,7 +1371,7 @@
break;
case Connected:
case CloseWrite:
conn->data_cb(conn, NULL, code);
if (conn->data_cb) conn->data_cb(conn, NULL, code);
break;
default:
CONN_LOG(WARN, "disconnecting from state[%d]", st);
Expand Down
Loading