fix Dart Builder._writeString() - always write trailing zero byte (#6390)
authorIvan Dlugos <6349682+vaind@users.noreply.github.com>
Thu, 7 Jan 2021 19:40:47 +0000 (20:40 +0100)
committerGitHub <noreply@github.com>
Thu, 7 Jan 2021 19:40:47 +0000 (11:40 -0800)
dart/lib/flat_buffers.dart

index 0f4ccbc..99fd6a2 100644 (file)
@@ -670,6 +670,7 @@ class Builder {
     for (int i = 0; i < length; i++) {
       _buf.setUint8(offset++, bytes[i]);
     }
+    _buf.setUint8(offset, 0); // trailing zero
     return result;
   }