jnr / jnr-ffi

Java Abstracted Foreign Function Layer
Other
1.26k stars 157 forks source link

AsciiStringRef / UTF8StringRef memory safety concerns #285

Open charleskorn opened 3 years ago

charleskorn commented 3 years ago

From #276:

I'm not sure if my changes are correct though:

  • should UTFStringRef.set() also update this.length to the length of the new string value?
  • should we be allocating additional space for the null terminator character in the call to getRuntime().getMemoryManager().allocateDirect()?