Re: Public disclosure of discovered vulnerabilities
From: Bryan Olson (fakeaddress_at_nowhere.org)
Date: 05/26/05
- Next message: Bryan Olson: "Re: Public disclosure of discovered vulnerabilities"
- Previous message: Douglas A. Gwyn: "Re: HELP - trapdoor functions"
- In reply to: Douglas A. Gwyn: "Re: Public disclosure of discovered vulnerabilities"
- Next in thread: Bryan Olson: "Re: Public disclosure of discovered vulnerabilities"
- Reply: Bryan Olson: "Re: Public disclosure of discovered vulnerabilities"
- Reply: Douglas A. Gwyn: "Re: Public disclosure of discovered vulnerabilities"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Wed, 25 May 2005 23:44:46 GMT
Douglas A. Gwyn wrote:
> Bryan Olson wrote:
>
>> ... Similarly, Gwyn was wrong when he wrote:
>> The toupper function has an int argument, not char, and it
>> is perfectly safe to feed it any character code (or EOF).
>>
>> According to the standard, that is false. Character codes may be
>> negative, and toupper() yields undefined behavior for any such
>> code that doesn't happen to equal EOF.
>
> I am unaware of any character encoding scheme
> in actual use that employs negative values;
Obviously you were unaware. Your unawareness, whether of
character codes or of the C standard, is obviously what lead you
say that certain C programming practices are "perfectly safe",
when in fact they can induce undefined behavior.
Ever heard of the IBM PC? It's native character set, still in
use, includes codes that are negative in some C implementations.
(It has smilies and playing-card-suits and crap.) I cannot
attest that those implementations are entirely standard-
conferment, but their use of negative character codes is legal
under the standard. That stuff in the C standard about "basic
character set" and "extended character set": do you have any
idea what it means?
But more to the point, is honesty too much to ask? Since when
has your position been that C code is fine as long as it
survives in the well-known implementations, even if it induces
undefined behavior according to the standard?
> toupper works fine when used with actual
> character codes.
Warning: Do not believe Gwyn. Following his guidance in this
case can result in code with undefined behavior under the C
standard.
> If you're going to play
> around with negative codes you had better know
> what you're doing and take the steps necessary
> for your oddball computation to work. There
> is no reason that the standard library should
> be bogged down with extra masks and/or range
> checks that aren't needed in the vast majority
> of cases, when they can easily be added by the
> occasional program that needs them. If you
> want a slow PL, there are plenty to choose from.
In the future, when you imply that only incompetent programmers
produce or accept C code with undefined behavior, you will
remember that you in that group? Right?
-- --Bryan
- Next message: Bryan Olson: "Re: Public disclosure of discovered vulnerabilities"
- Previous message: Douglas A. Gwyn: "Re: HELP - trapdoor functions"
- In reply to: Douglas A. Gwyn: "Re: Public disclosure of discovered vulnerabilities"
- Next in thread: Bryan Olson: "Re: Public disclosure of discovered vulnerabilities"
- Reply: Bryan Olson: "Re: Public disclosure of discovered vulnerabilities"
- Reply: Douglas A. Gwyn: "Re: Public disclosure of discovered vulnerabilities"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|