October 25, 2012 Re: Intended Security Hole? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Manfred Nowak | On Thursday, 25 October 2012 at 12:43:34 UTC, Manfred Nowak wrote: > Maxim Fomin wrote: > >> Then disable behavior by marking class or function as a final. > Do you really mean by this, that "aspect programming" is impossible in > D? > Or that marking `final' is enough? I mean that if you mark function in Base class as final or private, you can be sure that derived classes do not override functions you want to be non-overriden. So, if virtual call creates problems for you, you can disable it. >> provide an example how you can do this. > I was in fear and posted an approach. But I was not sure. Therefore I > asked for a proof, that my fear had not cause in reality. > Your demand for an example only expresses, that you too are guided by > expectations only, not by proofs. > > - manfred I definitely not driven by fear whether declared only functions can be hijacked at runtime or not. References to functions with omitted bodies are captured by linker at link-time at implementation-defined and platform specific manner. At linux if you provide multiple definition of same symbol order of arguments does matter. At windows either linker complains about twice defined symbol or reject linking at all - I don't remember. This is not important because linking is typically under of your rather than "unknown coder" control. At runtime it is possible to use system facilities and hacking tools by "unknown coder" to overwrite memory for attacking purposes and may be for changing implementation of some function. But this affects functions with definitions as well as functions with omitted bodies and is unrelated to how one language treats functions without definitions. I don't understand what is an issue: treating declared only functions by dmd, virtual calls or changing function implementation at runtime. |
October 25, 2012 Re: Intended Security Hole? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Manfred Nowak | On Thursday, 25 October 2012 at 13:03:30 UTC, Manfred Nowak wrote:
> Maxim Fomin wrote:
>
>> Why now you are complaining about this?
> Because this is the learn group and I did not realize, that the
> compiler does conform to the definition of "overload resolution" in
> function.html#function-inheritance, i.e. my expectation is defined as a
> bug.
>
> - manfred
>
>
By complaining i implied surprising by behavior not posting
messages.
|
Copyright © 1999-2021 by the D Language Foundation