Re: security enhacement to C runtime library (XXX_s)



Zeppe wrote:
... But I wonder if it could have been
possible, and a good idea, to make the user choose whether to use a safe
implementation, with the same names, of at least these functions that
don't need any change in the function declaration. That would have
allowed a lot of code to become safe without any modification and
without losing portability.

The simple answer is that it wouldn't work. Some implementations
are simply not capable of checking whether the boundsless interfaces
are properly used. In principle, one could change the C compiler
and run-time system to perform *most* boundary checks, but there
would be a stiff performance penalty to pay for that feature. There
is nothing to prevent a compiler from detecting *some* boundary
errors at compile time, and I believe that some do that already.

A guiding principle behind the recent "safer interfaces" TR was not
that the functions have identical interfaces to the traditional ones,
but rather that they have similar interfaces with the bounds added
in a consistent way, making it relatively easy to edit existing code
to use the new functions in place of the traditional ones.
.



Relevant Pages

  • Re: Grundsatzfrage zum Klassen-Design
    ... Dass, wenn sich Tabellen ändern, sowohl Du als auch ich in den Code ... Sicherlich haben Interfaces ihren Zweck. ... den Compiler zum Generieren von Fehlermeldungen zu bewegen. ... weil mich SPs nun endgültig auf eine DBE festnageln. ...
    (microsoft.public.de.german.entwickler.dotnet.csharp)
  • Re: Apple IIGS ROM 1 or ROM 3, which is better?
    ... of the *simple* indirection cost can be amortized, but compiler ... and every methodology has a terrible dark side. ... code with firm interfaces allowing isolation and factorization. ... the most demanding design activities. ...
    (comp.sys.apple2)
  • Re: [RFC] LZO de/compression support - take 3
    ... Lets just add the _unsafe postfix and leave "safe" alone, ... I don't like the symlink much either. ... I suspect it will probably damage performance unless the compiler is ...
    (Linux-Kernel)
  • Re: Grundsatzfrage zum Klassen-Design
    ... VB6-Zeiten unter Interfaces. ... >> darüberhinaus Deine Klasse MyEmailManager! ... > nicht alle Stellen enstsprechend der Änderung anpasst. ... Sie sind nicht durch den Compiler zu finden. ...
    (microsoft.public.de.german.entwickler.dotnet.csharp)
  • Re: Check a radio button
    ... building systems, which is that you have to keep the compiled code consistent with the ... Key here is that you are thinking that you can enhance interfaces without rebuilding the ... of bugs would simply be due to compiler changes. ...
    (microsoft.public.vc.mfc)