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

[XrdHttp] Fix one-byte overrun in Tobase64() #1012

Merged
merged 1 commit into from
Jun 26, 2019

Conversation

jthiltges
Copy link
Contributor

The allocated target buffer for base64 output is sometimes too short, leading to an overrun. (And I suspect it's causing memory corruption with eventual misbehavior and segfaults.)

A hex string may be the same length as the base64 representation. To allow for a terminating null on the base64 string, we need to allocate an additional byte.

string abcd
   hex 61626364
base64 YWJjZA==

Allocate an additional byte to allow for a terminating null in the base64 output
@jthiltges
Copy link
Contributor Author

Hi @ffurano. We're working on fixing some xrootd stability and behavior issues at Nebraska, and an ASAN build uncovered this buffer overrun. It would be great to see it in the upcoming v4.10 release if there's time.

Thanks!

@zvada
Copy link

zvada commented Jun 25, 2019

Ideally, this would be good to get into v4.10.0 RC5 that we can proceed with tests in larger pool of hosts. Or, directly to the release unless there are any plans for RC5. Do you think we can we make it, @simonmichal and @ffurano ?

@ffurano ffurano merged commit a015875 into xrootd:master Jun 26, 2019
@jthiltges jthiltges deleted the b64-overrun branch April 22, 2021 17:20
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 this pull request may close these issues.

None yet

3 participants