Re: [Lit.] Buffer overruns
newstome_at_comcast.net
Date: 12/10/04
- Next message: Jean-Luc Cooke: "Re: Randomness of Shuffling? - Possible?"
- Previous message: Mok-Kong Shen: "Re: [Lit.] Buffer overruns"
- In reply to: Douglas A. Gwyn: "Re: [Lit.] Buffer overruns"
- Next in thread: Bryan Olson: "Re: [Lit.] Buffer overruns"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Fri, 10 Dec 2004 15:43:53 GMT
Douglas A. Gwyn <DAGwyn@null.net> wrote:
> David Wagner wrote:
>> It's too bad the C language specified a terminated-string library
>> as part of the language specification, rather than a counted-string
>> library. We might have seen fewer buffer overruns if the latter had
>> been the case.
>
> Buffer overruns are not due to the design of the str*
> functions, but rather to programmer oversight and/or
> laziness. Most buffer overrun problems have nothing
> to do with the str* functions. This noise about the
> str* functions distracts from addressing the *real*
> problem.
A fine distinction, unless of course you want to live in the real
world. You can say that C strings work as defined, so any mistakes
are due to improper use, and you'd be right. But you can't deny that
a huge portion of non-robust (or insecure) software is due to improper
string handling in C. This is a real problem -- and if you have a
real problem, you want (or I want!) a real solution, and two come to
mind immediately:
1) Make sure all C programmers are highly trained and never make
mistakes.
2) Make standard constructs safer in C.
The probability of option 1 is basically zero. Not only do very good
programmers sometimes makes mistakes (hell, I'm a very good programmer
and I certainly make mistakes), but you can't ignore the fact that
there are a lot of people that use C that don't even approach the
"competent" label (see the Diebold voting machine code for a concrete
example). This is a reality of life, and just saying "well it's their
fault" it completely unhelpful.
-- That's News To Me! newstome@comcast.net
- Next message: Jean-Luc Cooke: "Re: Randomness of Shuffling? - Possible?"
- Previous message: Mok-Kong Shen: "Re: [Lit.] Buffer overruns"
- In reply to: Douglas A. Gwyn: "Re: [Lit.] Buffer overruns"
- Next in thread: Bryan Olson: "Re: [Lit.] Buffer overruns"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|