Am 30.09.2016 um 07:22 schrieb Adrien Destugues:
On Thu, Sep 29, 2016 at 10:57:25PM +0200, pulkomandy@xxxxxxxxxxxxx wrote:
f638c82a22f6: StyledText: fix reading of utf-8 documents
BNode::ReadAttrString does not check for the attribute to actually be a
string. It will return B_OK (and useless data) if called on a
B_INT32_TYPE attribute.
I wonder if that's expected behavior from ReadAttrString (and ReadAttr
which it uses). They use fs_read_attr, which has a "type" parameter, but
does not forward it to the underlying syscall.
Should the type check be done:
- In calling code as I did?
- In BNode?
- In fs_read_attr? (both of these three would cost an extra call to
fs_stat_attr)
- In the syscall used to read an attribute? (but not all filesystems may
allow it?)