| 52 | namespace { |
| 53 | |
| 54 | Status MaybeAlignMetadata(std::shared_ptr<Buffer>* metadata) { |
| 55 | if (reinterpret_cast<uintptr_t>((*metadata)->data()) % 8 != 0) { |
| 56 | // If the metadata memory is not aligned, we copy it here to avoid |
| 57 | // potential UBSAN issues from Flatbuffers |
| 58 | ARROW_ASSIGN_OR_RAISE(*metadata, (*metadata)->CopySlice(0, (*metadata)->size())); |
| 59 | } |
| 60 | return Status::OK(); |
| 61 | } |
| 62 | |
| 63 | Status CheckMetadataAndGetBodyLength(const Buffer& metadata, int64_t* body_length) { |
| 64 | const flatbuf::Message* fb_message = nullptr; |
no test coverage detected