jnr / jnr-ffi

Java Abstracted Foreign Function Layer
Other
1.23k stars 154 forks source link

AsciiStringRef / UTF8StringRef memory safety concerns #285

Open charleskorn opened 2 years ago

charleskorn commented 2 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()?