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

Removed usage of strcpy to enhance security of the client #1745

Merged
merged 3 commits into from
May 16, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# Confluent's Python client for Apache Kafka

## v2.4.1

v2.4.1 is a maintenance release with the following fixes and enhancements:

- Removed usage of `strcpy` to enhance security of the client (#1745)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given we're saying this, please remove also the usage in confluent_kafka.c so we don't have other occurrences


confluent-kafka-python is based on librdkafka v2.4.1, see the
[librdkafka release notes](https://github.com/confluentinc/librdkafka/releases/tag/v2.4.1)
for a complete list of changes, enhancements, fixes and upgrade considerations.


## v2.4.0

v2.4.0 is a feature release with the following features, fixes and enhancements:
Expand Down
8 changes: 4 additions & 4 deletions src/confluent_kafka/src/Admin.c
Original file line number Diff line number Diff line change
Expand Up @@ -160,28 +160,28 @@ Admin_options_to_c (Handle *self, rd_kafka_admin_op_t for_api,
if (Admin_options_is_set_int(options->require_stable_offsets) &&
(err_obj = rd_kafka_AdminOptions_set_require_stable_offsets(
c_options, options->require_stable_offsets))) {
strcpy(errstr, rd_kafka_error_string(err_obj));
snprintf(errstr, sizeof(errstr), "%s", rd_kafka_error_string(err_obj));
goto err;
}

if (Admin_options_is_set_int(options->include_authorized_operations) &&
(err_obj = rd_kafka_AdminOptions_set_include_authorized_operations(
c_options, options->include_authorized_operations))) {
strcpy(errstr, rd_kafka_error_string(err_obj));
snprintf(errstr, sizeof(errstr), "%s", rd_kafka_error_string(err_obj));
goto err;
}

if (Admin_options_is_set_int((int)options->isolation_level) &&
(err_obj = rd_kafka_AdminOptions_set_isolation_level(
c_options,options->isolation_level))) {
strcpy(errstr, rd_kafka_error_string(err_obj));
snprintf(errstr, sizeof(errstr), "%s", rd_kafka_error_string(err_obj));
goto err;
}

if (Admin_options_is_set_ptr(options->states) &&
(err_obj = rd_kafka_AdminOptions_set_match_consumer_group_states(
c_options, options->states, options->states_cnt))) {
strcpy(errstr, rd_kafka_error_string(err_obj));
snprintf(errstr, sizeof(errstr), "%s", rd_kafka_error_string(err_obj));
goto err;
}

Expand Down