-
Notifications
You must be signed in to change notification settings - Fork 1.7k
[AVRO-4248] Fix misaligned pointer use in BufferDetail.hh and BufferReader.hh #3740
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,6 +20,7 @@ | |
| #define avro_BufferDetail_hh__ | ||
|
|
||
| #include <cassert> | ||
| #include <cstring> | ||
| #include <deque> | ||
| #include <exception> | ||
| #include <functional> | ||
|
|
@@ -320,7 +321,7 @@ public: | |
| if (freeSpace_ && (sizeof(T) <= writeChunks_.front().freeSize())) { | ||
| // fast path, there's enough room in the writeable chunk to just | ||
| // straight out copy it | ||
| *(reinterpret_cast<T *>(writeChunks_.front().tellWritePos())) = val; | ||
| memcpy(writeChunks_.front().tellWritePos(), &val, sizeof(T)); | ||
| postWrite(sizeof(T)); | ||
| } else { | ||
| // need to fixup chunks first, so use the regular memcpy | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In the I am not C++ dev, so I don't know whether this needs fixing or not.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The actual implementation of writeTo is a memcpy: |
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.