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

Access to previously freed memory #704

Closed
FilipeMaia opened this issue Jan 15, 2025 · 0 comments · Fixed by #706
Closed

Access to previously freed memory #704

FilipeMaia opened this issue Jan 15, 2025 · 0 comments · Fixed by #706

Comments

@FilipeMaia
Copy link

FilipeMaia commented Jan 15, 2025

As full_fname returns a static pointer when it's used twice in the same print message the second call will free the space allocated for by the first full_fname call, causing rsyserr to read freed memory, as in here:

rsync/generator.c

Lines 2044 to 2045 in dacadd5

rsyserr(FERROR_XFER, errno, "rename %s -> \"%s\" failed",
full_fname(tmpname), full_fname(fname));

This may cause gibberish output or potentially even a SIGSEV.

ncopa added a commit to ncopa/rsync that referenced this issue Jan 15, 2025
full_fname() will free the return value in the next call so we need to
duplicate it before passing it to rsyserr.

Fixes: RsyncProject#704
algitbot pushed a commit to alpinelinux/aports that referenced this issue Jan 15, 2025
algitbot pushed a commit to alpinelinux/aports that referenced this issue Jan 15, 2025
algitbot pushed a commit to alpinelinux/aports that referenced this issue Jan 15, 2025
algitbot pushed a commit to alpinelinux/aports that referenced this issue Jan 15, 2025
tridge pushed a commit that referenced this issue Jan 15, 2025
full_fname() will free the return value in the next call so we need to
duplicate it before passing it to rsyserr.

Fixes: #704
bell-sw pushed a commit to bell-sw/alpaquita-aports that referenced this issue Jan 16, 2025
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.

1 participant