Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid DSN causes crash #525

Closed
2 tasks
kristjanvalur opened this issue Apr 22, 2021 · 1 comment · Fixed by #527
Closed
2 tasks

Invalid DSN causes crash #525

kristjanvalur opened this issue Apr 22, 2021 · 1 comment · Fixed by #527
Assignees

Comments

@kristjanvalur
Copy link

Description

Passing an invalid DSN during sentry_options_set_dsn() causes crash

When does the problem happen

  • During build
  • [x ] During run-time
  • When capturing a hard crash

Environment

  • OS: Windows 10, 64-bit
  • Compiler: MSVC 19

Steps To Reproduce
Pass a dsn starting wiht "=" to sentry, e.g.
"=https://abcde633355b4cf58e888b63328f68b1@o454214.ingest.sentry.io/1234567"

Log output
Sentry crashes during url cleanup with call stack:

 	ucrtbase.dll!00007fffca63f05b()	Unknown
 	UE4Editor-SentryClient-Win64-DebugGame.dll!sentry__url_cleanup(sentry_url_t * url) Line 206	C
>	UE4Editor-SentryClient-Win64-DebugGame.dll!sentry__dsn_new(const char * raw_dsn) Line 273	C
 	UE4Editor-SentryClient-Win64-DebugGame.dll!sentry_options_set_dsn(sentry_options_s * opts, const char * raw_dsn) Line 120	C

It is trying to free a nullptr (url->host) here:

void
sentry__url_cleanup(sentry_url_t *url)
{
    sentry_free(url->scheme);
    sentry_free(url->host);
    sentry_free(url->path);
    sentry_free(url->query);
    sentry_free(url->fragment);
    sentry_free(url->username);
    sentry_free(url->password);

All the url components, except scheme, are NULL

@Swatinem
Copy link
Member

It is trying to free a nullptr (url->host) here:

sentry_free is nullptr-safe. This is rather a double-free, as sentry__url_cleanup is called twice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants