[7250] in bugtraq
Re: ncurses 4.1 security bug
daemon@ATHENA.MIT.EDU (Ben Laurie)
Mon Jul 13 16:02:35 1998
Date: Sun, 12 Jul 1998 11:51:29 +0100
Reply-To: Ben Laurie <ben@ALGROUP.CO.UK>
From: Ben Laurie <ben@ALGROUP.CO.UK>
X-To: David Schwartz <davids@webmaster.com>
To: BUGTRAQ@NETSPACE.ORG
David Schwartz wrote:
> How do you think the compiler would interpret the following:
>
> MyString Foo="test";
>
> It would _have_ to call a constructor. There is no other way to make a
> 'MyString'. So your distinction is a distinction without a difference.
That's my point. MyString requires a call to a constructor. An int
doesn't. That's the difference.
> No you cannnot know that _in_general_. The code 'int
> MyString::StringCount=0;' and the code 'MyString Foo="test"' are on an equal
> level -- both construct global objects and initialize them to sane states.
> So in general, you can't know which will occur first.
No, we know that 'int MyString::StringCount=0;' is done first, because
it needs no run-time initialisation.
Cheers,
Ben.
--
Ben Laurie |Phone: +44 (181) 735 0686| Apache Group member
Freelance Consultant |Fax: +44 (181) 735 0689|http://www.apache.org/
and Technical Director|Email: ben@algroup.co.uk |
A.L. Digital Ltd, |Apache-SSL author http://www.apache-ssl.org/
London, England. |"Apache: TDG" http://www.ora.com/catalog/apache/
WE'RE RECRUITING! http://www.aldigital.co.uk/recruit/