This is the mail archive of the cygwin-patches@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH]Setup.Exe causes Application Error at 0x78001750


From: "Robert Collins" <robert.collins@itdomain.com.au>
To: "Pavel Tsekov" <ptsekov@gmx.net>; <cygwin-apps@cygwin.com>
Cc: "Seitz, Matt" <mseitz@snapserver.com>; <cygwin@cygwin.com>
Sent: Friday, March 22, 2002 20:33
Subject: RE: [Possible BUG and a fix] Re[2]: Setup.Exe causes Application
Error at 0x78001750


> From: Pavel Tsekov [mailto:ptsekov@gmx.net]
> Sent: Saturday, March 23, 2002 11:03 AM

>   strcpy (dp, dots);
>   delete[] dots;
>   key = String (dp);
>
> LOOK HERE - This is not right - we should delete at the base
> of the block, not somewhere in the middle of it.
>   delete[] dp;
>
> We can do something like that
> char *dp = ....
> char *dp_save = dp;
>
>  ....
>
>  delete[] dp_save;

] Huh? delete[]dp; is the last reference to dp. delete[]dots; is the last
] reference to dots. Whats the problem?

dp is modified so doesn't point to the base of the allocated area by the
time delete[] dp is called.  A separate working variable should be used
rather than modifying the allocation pointer.
--
Mac :})
** I normally forward private questions to the appropriate mail list. **
Ask Smarter: http://www.tuxedo.org/~esr/faqs/smart-questions.html
Give a hobbit a fish and he eats fish for a day.
Give a hobbit a ring and he eats fish for an age.

Changelog:

2002-03-22  Michael A Chase <mchase@ix.netcom.com>

    * site.cc (site_list_type::init): Preserve allocation pointer for key
buffer.

Attachment: cinstall-mac-020322-1.patch
Description: Binary data


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]