eyurtsev / fcsparser

A python parser for reading fcs files supporting FCS 2.0, 3.0, 3.1
MIT License
74 stars 45 forks source link

Fix unsafe loading from file buffer #58

Closed felixthebeard closed 1 year ago

felixthebeard commented 1 year ago

The numpy documentation states for numpy.frombuffer` that:

This function creates a view into the original object. This should be safe in general, but it may make sense to copy the result when the original object is mutable or untrusted.

When the filebuffer is mutable a ValueError: output array is read-only is raised in: https://github.com/eyurtsev/fcsparser/blob/701000af178e36e0dedb53d409119c25675b9d16/fcsparser/api.py#L590

eyurtsev commented 1 year ago

Thanks @felixthebeard