Skip to content

Commit

Permalink
fix off-by-one error in String.cstring (#2616)
Browse files Browse the repository at this point in the history
that could surface if the newly allocated cstring buffer is not set ot 0 completely
  • Loading branch information
mfelsche authored and jemc committed Mar 31, 2018
1 parent 922c028 commit 1190a57
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/builtin/string.pony
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ actor Main

let ptr = Pointer[U8]._alloc(_size + 1)
_ptr._copy_to(ptr._unsafe(), _size)
ptr._update(_size + 1, 0)
ptr._update(_size, 0)
ptr

fun val array(): Array[U8] val =>
Expand Down

0 comments on commit 1190a57

Please sign in to comment.