[UserMetaData] Handle changes in attribute data size correctly
ClosedPublic

Authored by bruns on Mar 30 2019, 10:45 PM.

Details

Summary

There is no guarantee the attribute size does not change between two
getxattr calls (and the man page explicitly mentions this case).

In case the attribute grows only a truncated value is returned, when it
shrinks, garbage is returned. In both cases Unicode decoding errors can
happen.

Test Plan

ctest

Diff Detail

Repository
R286 KFileMetaData
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
bruns created this revision.Mar 30 2019, 10:45 PM
Restricted Application added projects: Frameworks, Baloo. · View Herald TranscriptMar 30 2019, 10:45 PM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
bruns requested review of this revision.Mar 30 2019, 10:45 PM
ngraham accepted this revision.Mar 31 2019, 2:25 AM
This revision is now accepted and ready to land.Mar 31 2019, 2:25 AM
This revision was automatically updated to reflect the committed changes.