Detect incorrect paramenter in findProtocol
ClosedPublic

Authored by jtamate on Mar 4 2018, 9:36 AM.

Details

Summary

Add two Q_ASSERT to detect incorrect protocols like:

  • "" (empty parameter)
  • smb:/// (the right one is smb)
  • zip:/home/user/Download/......./Encoder.php (the right one is zip)

Diff Detail

Repository
R241 KIO
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
jtamate created this revision.Mar 4 2018, 9:36 AM
Restricted Application added a project: Frameworks. · View Herald TranscriptMar 4 2018, 9:36 AM
jtamate requested review of this revision.Mar 4 2018, 9:36 AM
dfaure requested changes to this revision.Mar 4 2018, 10:08 AM

It's called protocol, it's supposed to be just the protocol. The bug is in the caller.

This revision now requires changes to proceed.Mar 4 2018, 10:08 AM
jtamate updated this revision to Diff 28679.Mar 5 2018, 9:39 AM
jtamate retitled this revision from Remove trailing data in the protocol parameter in findProtocol to Detect incorrect paramenter in findProtocol.
jtamate edited the summary of this revision. (Show Details)
jtamate edited the test plan for this revision. (Show Details)

I've detected so far only the case of KProtocolInfo::icon with "", in a dependent revision.

dfaure accepted this revision.Mar 5 2018, 10:14 AM

Yes, but please don't push this until you have fixed the caller in your testcase, and used a Plasma/KF5 session with these asserts enabled for 2 weeks.

Thanks ;)

This revision is now accepted and ready to land.Mar 5 2018, 10:14 AM
This revision was automatically updated to reflect the committed changes.