getsentry / sentry-native

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

SIGSEGV possible via `sentry_envelope_write_to_path` when path is invalid #1035

Closed mitchellh closed 3 months ago

mitchellh commented 3 months ago

Description

SIGSEGV possible through sentry_envelope_write_to_path

When does the problem happen

Environment

macOS, but probably doesn't matter.

Steps To Reproduce

If you provide a path using a directory that doesn't exist, then sentry__filewriter_new returns NULL. The sentry_envelope_write_to_path never checks for a null result and attempts to use the fw.

supervacuus commented 3 months ago

Ouch, thanks for the report!

supervacuus commented 3 months ago

The fix was released in 0.7.9.