On Saturday, 16 April 2016 at 21:58:35 UTC, ag0aep6g wrote:
On 16.04.2016 20:48, FreeSlave wrote:
github repo: https://github.com/MyLittleRobo/mimeapps (examples included)

You've got some bad `@trusted`s in your code:


<https://github.com/MyLittleRobo/mimeapps/blob/03b53ce35d2f4f56fdf76e0b6f5c681660b9d23a/source/mimeapps.d#L29>:

The constraint allows user-defined types that implicitly convert to const(char)[] via alias this. Such a type may, for example, have an unsafe opAssign, which you're mistakenly trusting here.

I would better use inout here, but it has problems with Tuples. I don't know how to rewrite this code to inout so it still remained buildable. The other way of course is to rewrite constraints to match real strings only not types with alias this.

<https://github.com/MyLittleRobo/mimeapps/blob/03b53ce35d2f4f56fdf76e0b6f5c681660b9d23a/source/mimeapps.d#L191>,
<https://github.com/MyLittleRobo/mimeapps/blob/03b53ce35d2f4f56fdf76e0b6f5c681660b9d23a/source/mimeapps.d#L308>:

Similarly, IniLikeReader may do unsafe stuff and can't be trusted.

This is usually constructed from iniLikeStringReader or iniLikeFileReader from inilike library, but yeah, generally it can be non-trusted user-defined type. Thanks for pointing out. Will fix it.

Reply via email to