mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-24 22:26:10 +00:00
Ensure strings are null terminated when written from Dart (#4862)
* Update for Dart 2.x constants * Fix strings, update test, add CHANGELOG for Dart
This commit is contained in:
committed by
Wouter van Oortmerssen
parent
38a6623f34
commit
fd40cc61a4
@@ -662,7 +662,7 @@ class Builder {
|
||||
// TODO(scheglov) optimize for ASCII strings
|
||||
List<int> bytes = utf8.encode(value);
|
||||
int length = bytes.length;
|
||||
_prepare(4, 1, additionalBytes: length);
|
||||
_prepare(4, 1, additionalBytes: length + 1);
|
||||
final int result = _tail;
|
||||
_setUint32AtTail(_buf, _tail, length);
|
||||
int offset = _buf.lengthInBytes - _tail + 4;
|
||||
|
||||
Reference in New Issue
Block a user