[MPRIS Data Engine] Don't crash if "Metadata" is a map but of wrong type
ClosedPublic

Authored by broulik on Jan 4 2017, 12:36 PM.

Details

Reviewers
davidedmundson
Group Reviewers
Plasma
Summary

QDBusArgument MapType fits all kinds of maps but when we try to stream a map of type other than a{sv} (which the MRPIS spec requires) into a QVariantMap we would crash. Explicitly check signature to avoid this.

BUG: 374531
FIXED-IN: 5.8.6

Test Plan

This is clearly an application bug, Metadata *must* be a{sv} according to spec but we shouldn't render Plasma unusable if a client is stupid.

Verified that metadata in VLC player (album art, artist, etc) still works

I'll try to create a small testcase and report that issue to Qt, it shouldn't crash in

QVariantMap map;
map << arg; // oops, it's not a{sv} but a{ss}

Diff Detail

Repository
R120 Plasma Workspace
Lint
Lint Skipped
Unit
Unit Tests Skipped
broulik updated this revision to Diff 9700.Jan 4 2017, 12:36 PM
broulik retitled this revision from to [MPRIS Data Engine] Don't crash if "Metadata" is a map but of wrong type.
broulik updated this object.
broulik edited the test plan for this revision. (Show Details)
broulik added a reviewer: Plasma.
broulik set the repository for this revision to R120 Plasma Workspace.
Restricted Application added a project: Plasma. · View Herald TranscriptJan 4 2017, 12:36 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
broulik edited the test plan for this revision. (Show Details)Jan 4 2017, 12:53 PM
davidedmundson accepted this revision.Jan 4 2017, 12:58 PM
davidedmundson added a reviewer: davidedmundson.
davidedmundson added a subscriber: davidedmundson.

I'll try to create a small testcase and report that issue to Qt, it shouldn't crash in

Yeah, it really shouldn't.

This revision is now accepted and ready to land.Jan 4 2017, 12:58 PM