Skip to content

BsonWriter::write<Binary::Ptr> missing size ? #750

@obiltschnig

Description

@obiltschnig

From http://sourceforge.net/p/poco/bugs/630/:

It looks like size of binary data is not written during serialization in MongoDB/Binary.h

Instead of

inline void BSONWriter::write<Binary::Ptr>(Binary::Ptr& from)
{
    _writer << from->subtype();
    _writer.writeRaw((char*) from->buffer().begin(), from->buffer().size());
}

should be something like this?

inline void BSONWriter::write<Binary::Ptr>(Binary::Ptr& from)
{
    _writer << (Poco::Int32)from->buffer().size();
    _writer << from->subtype();
    _writer.writeRaw((char*) from->buffer().begin(), from->buffer().size());
}

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions