analyzer icon indicating copy to clipboard operation
analyzer copied to clipboard

Precise `strdup`

Open sim642 opened this issue 10 months ago • 6 comments

Currently strdup (and strndup) return an unknown pointer, which can make things very imprecise. Instead we should:

  • [ ] Return a pointer to freshly allocated memory, the same way as malloc.
  • [ ] Create a corresponding blob as its value.
  • [ ] Blob size should come from the argument string constant or blob size.
  • [ ] Blob contents should copy the argument blob contents or summarize the string constant.
  • [ ] strndup should additionally only have maximum length n and copy as long prefix.

sim642 avatar Aug 21 '23 14:08 sim642