Skip to content

Lwt_unix should use caml_unix_check_path or caml_string_is_c_safe for C stubs that take a string as input #1124

Description

@edwintorok

For the Unix module this got fixed in OCaml 4.03 ocaml/ocaml#227, but Lwt still allows them.

Lwt_unix.openfile "/tmp/test\x00test" [Unix.O_CREAT;Unix.O_RDWR] 0;;
- : Lwt_unix.file_descr = <abstr>
Unix.openfile "/tmp/foox\x00bar" [Unix.O_CREAT;Unix.O_RDWR] 0;;
Exception: Unix.Unix_error(Unix.ENOENT, "open", "/tmp/foox\000bar")

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions