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 @@ -4536,7 +4536,16 @@ static PyObject * Admin_c_SingleGroupResult_to_py(const rd_kafka_group_result_t
45364536
45374537 kwargs = PyDict_New ();
45384538
4539- cfl_PyDict_SetString (kwargs , "group_id" , rd_kafka_group_result_name (c_group_result_response ));
4539+ /* Safely handle potential NULL group name from librdkafka */
4540+ const char * group_name = rd_kafka_group_result_name (c_group_result_response );
4541+ if (!group_name ) {
4542+ cfl_PyErr_Format (RD_KAFKA_RESP_ERR__INVALID_ARG ,
4543+ "Received NULL group name from librdkafka" );
4544+ Py_DECREF (kwargs );
4545+ Py_DECREF (GroupResult_type );
4546+ return NULL ;
4547+ }
4548+ cfl_PyDict_SetString (kwargs , "group_id" , group_name );
45404549
45414550 c_topic_partition_offset_list = rd_kafka_group_result_partitions (c_group_result_response );
45424551 if (c_topic_partition_offset_list ) {
You can’t perform that action at this time.
0 commit comments