Azure / azure-sdk-for-java

This repository is for active development of the Azure SDK for Java. For consumers of the SDK we recommend visiting our public developer docs at https://docs.microsoft.com/java/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-java.
MIT License
2.35k stars 1.99k forks source link

java.lang.NullPointerException when application properties with null value are present #41199

Open mikemwalsh opened 3 months ago

mikemwalsh commented 3 months ago

In a new edge case we are forwarding AMQP messages from another AMQP broker to event hub. The source allows application properties with a value of null. When this occurs, the code linked below throws a null pointer exception because there is no null checking in the sizeof call for the property values

https://github.com/Azure/azure-sdk-for-java/blob/f0bb03edd0c46d198093d73ea932bb9f6d05cc98/sdk/eventhubs/azure-messaging-eventhubs/src/main/java/com/azure/messaging/eventhubs/EventHubMessageSerializer.java#L89

Reproduction:

Suggested Fix:

github-actions[bot] commented 3 months ago

@anuchandy @conniey @lmolkova

github-actions[bot] commented 3 months ago

Thank you for your feedback. Tagging and routing to the team member best able to assist.