Re: [Lit.] Buffer overruns

From: Douglas A. Gwyn (DAGwyn_at_null.net)
Date: 12/09/04


Date: Wed, 08 Dec 2004 22:44:40 -0500

There are advantages and disadvantages to all the
plausible designs for handling character strings
and arbitrary data buffers. (For example, counted
strings have more space overhead than terminated
strings, an upper limit to length, and no sharing
of constant identical tails (unless even more
space and time overhead is added).) In C, you get
to choose the design you use, which might match an
existing design or be custom-tailored as you see
fit; nobody is forcing you to use a pre-existing
set of library functions if it happens not to be
appropriate for the task at hand. You can use
that freedom to duplicate any of the facilities
that you have described as more suitable; with C++
you can also use more convenient operator syntax
than is available with C.

There is also an important point that this whole
line of discussion keeps missing, namely: if the
programmer's assumptions are violated at run time,
something *unplanned* is going to happen, which is
bad from the security perspective. That is as true
with boundary-enforced buffer mechanisms as it is
for the sloppy UCB undergraduate hacks that so many
systems "borrowed" for their IP suite. At the very
least, you have a DoS vulnerabililty, but it could
be a lot worse -- since the program will execute
some "error" code that the programmer did not mean
to be executed. Imagine a medical control device
or an automotive or flight control device that
traps to a stack-trace abort when a boundary is
violated.



Relevant Pages

  • Re: A really good reference on digital filters
    ... Or strings, where you easily append two strings as ... was broken in 1994 and I am sure it's still broken - templates ... expence of a lot higher demands on program design). ... master the basics. ...
    (comp.dsp)
  • Re: Is the following little function UNICODE-safe? ...
    ... You will not be able to fit 500,000,000 4-byte strings into memory. ... extensions and assumes it can store three characters in a DWORD, ... pointer to a local variable, which is a fatal design error, as I already pointed out. ...
    (microsoft.public.vc.mfc)
  • Re: suhr bass
    ... None of those are serious "design" flaws. ... As for the strings and foam ... combined with the single coil pickups in strats and jazz basses mean ... bass guitar manufacturer, ...
    (alt.guitar.bass)
  • Re: another whammy/tremolo issue & headstocks
    ... the design of the headstock. ... This would seem to be a sleeker design for strings to move through. ... It's a straight path through the nut. ...
    (alt.guitar)