File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -4582,7 +4582,16 @@ static PyObject * Admin_c_SingleGroupResult_to_py(const rd_kafka_group_result_t
45824582
45834583 kwargs = PyDict_New ();
45844584
4585- cfl_PyDict_SetString (kwargs , "group_id" , rd_kafka_group_result_name (c_group_result_response ));
4585+ /* Safely handle potential NULL group name from librdkafka */
4586+ const char * group_name = rd_kafka_group_result_name (c_group_result_response );
4587+ if (!group_name ) {
4588+ cfl_PyErr_Format (RD_KAFKA_RESP_ERR__FAIL ,
4589+ "Received NULL group name from librdkafka" );
4590+ Py_DECREF (kwargs );
4591+ Py_DECREF (GroupResult_type );
4592+ return NULL ;
4593+ }
4594+ cfl_PyDict_SetString (kwargs , "group_id" , group_name );
45864595
45874596 c_topic_partition_offset_list = rd_kafka_group_result_partitions (c_group_result_response );
45884597 if (c_topic_partition_offset_list ) {
You can’t perform that action at this time.
0 commit comments