Skip to content

Commit

Permalink
fix: adjusted memcpy size param to match remaining destination size
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshuaMoelans committed Oct 4, 2024
1 parent dbb9580 commit f193d8c
Showing 1 changed file with 3 additions and 3 deletions.
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);
return rv;
} else {
return sentry__path_from_wstr(other);
Expand Down

0 comments on commit f193d8c

Please sign in to comment.