Skip to content

readr::read_file() and readr::read_file_raw() crash R session when given an empty raw vector #1590

@smartiing

Description

@smartiing

When passing an empty raw vector to readr::read_file() or readr::read_file_raw(), the R session immediately stops.

print(R.version.string)
#> [1] "R version 4.5.1 (2025-06-13 ucrt)"
packageVersion("readr")
#> [1] '2.1.5'
x = raw()
readr::read_file(x) # <-- Crash

Thanks for your time and for maintaining readr.

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