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

fix: adjusted memcpy size param to match remaining destination size #1047

Merged
merged 3 commits into from
Oct 9, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/path/sentry_path_windows.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,14 +164,14 @@ sentry__path_join_wstr(const sentry_path_t *base, const wchar_t *other)
return sentry__path_from_wstr(other);
} else if (other[0] == L'/' || other[0] == L'\\') {
if (isalpha(base->path[0]) && base->path[1] == L':') {
size_t len = wcslen(other) + 3;
sentry_path_t *rv = path_with_len(len);
size_t other_len = wcslen(other);
sentry_path_t *rv = path_with_len(other_len + 3);
if (!rv) {
return NULL;
}
rv->path[0] = base->path[0];
rv->path[1] = L':';
memcpy(rv->path + 2, other, sizeof(wchar_t) * len);
memcpy(rv->path + 2, other, sizeof(wchar_t) * other_len);
JoshuaMoelans marked this conversation as resolved.
Show resolved Hide resolved
return rv;
} else {
return sentry__path_from_wstr(other);
Expand Down
Loading