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 buffer overrun using PutN (closes #672) #673

Merged
merged 1 commit into from
Jul 1, 2016

Conversation

sjasonsmith
Copy link
Contributor

Fix inconsistent calling of template functions in PutN in stream.h. When
used with a GenericStringBuffer<, MemoryPoolAllocator>, PutN would call
PutReserve from stream.h, and PutUnsafe from stringbuffer.h. This
resulted in bytes being added to the buffer without allocating space.

This was not an issue when used with the default memory allocator,
because in this case the specialized PutN is used from stringbuffer.h.

Fix inconsistent calling of template functions in PutN in stream.h. When
used with a GenericStringBuffer<<UTF8>, MemoryPoolAllocator>, PutN would call
PutReserve from stream.h, and PutUnsafe from stringbuffer.h. This
resulted in bytes being added to the buffer without allocating space.

This was not an issue when used with the default memory allocator,
because in this case the specialized PutN is used from stringbuffer.h.
@coveralls
Copy link

coveralls commented Jun 30, 2016

Coverage Status

Coverage remained the same at 100.0% when pulling 252e812 on sjasonsmith:master into c79958a on miloyip:master.

@miloyip miloyip merged commit 727e2b9 into Tencent:master Jul 1, 2016
@miloyip
Copy link
Collaborator

miloyip commented Jul 1, 2016

Thank you

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