You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Base64-encoded values that start with zeroes result in empty messages when consumed from JSON:
To reproduce:
# create a topic
kafkactl create topic test_base64
# produce a value that starts with zeroesecho'{"Key": "foo", "Value": "AAAAAAAD"}'| kafkactl produce test_base64 --input-format=json --value-encoding=base64
# produce a value that doesn't start with zeroes, here it's "foo"echo'{"Key": "bar", "Value": "Zm9v"}'| kafkactl produce test_base64 --input-format=json --value-encoding=base64
# get contents of the topic in JSON format
kafkactl consume test_base64 --value-encoding=base64 --exit --from-beginning --output json
This seems to be due to the fact that the Base64 decoded byte arrays are assumed to be null-terminated strings and are
truncated at first zero byte, instead of using the decoder return value that signifies the amount of bytes decoded.
The text was updated successfully, but these errors were encountered:
Base64-encoded values that start with zeroes result in empty messages when consumed from JSON:
To reproduce:
Output:
This seems to be due to the fact that the Base64 decoded byte arrays are assumed to be null-terminated strings and are
truncated at first zero byte, instead of using the decoder return value that signifies the amount of bytes decoded.
The text was updated successfully, but these errors were encountered: