getsentry / sentry-native

Sentry SDK for C, C++ and native applications.
MIT License
405 stars 170 forks source link

fix: user-feedback comment guard #1020

Closed supervacuus closed 4 months ago

supervacuus commented 4 months ago

A recent review regarding strlen() usage revealed an invalid guard for the user-feedback comments parameter:

https://github.com/getsentry/sentry-native/blob/235f837e4038833154f07ed206bbf1b75788a9f0/src/sentry_value.c#L1274

A unit test didn't cover this, and my review also failed to see it. So, this is a good trigger for adding corresponding test cases, providing an inline function that guards strlen(), and introducing it to the codebase from which future contributors can adapt.