Re: Memory Manager DLL Validation




"Pierre le Riche" <pleriche@xxxxxxxxxxx> wrote in message
news:4264ca54@xxxxxxxxxxxxxxxxxxxxxxxxx
> Hi John,
>
>> I thought the rule finally agreed on was that it is allowed to write but
>> NOT modify any data beyond the last used character.
>
> How do you guarantee that the extra bytes you're writing is not modifying
> the data beyond the last used character? In a multi-threaded environment
> those bytes may change at any time, and unless you're going to resort to
> using "lock cmpxchg x, y" (which would kill performance) you'll never be
> safe.
>
> I propose that this rule be scrapped since it is not practical.
>
> IMO reading past the end is fine, but writing is not acceptable. Has
> anybody asked Borland's opinion on this? I'll bet they would also be
> against it.
>
> What if someone uses the Fastcode library together with their own MM or if
> they override NewInstance in a class and don't dword align the end?

Don't misunderstand me. I too, am against this rule.

In my opinion, we should never read or write beyond the null terminator
byte. I know Borland themselves do read beyond the null terminator (in
_LStrCmp), but I believe even that was an oversight. Unfortunately that
oversight means that AnsiStrings's must also be padded to a DWORD boundary
in any replacement Memory Manager.

regards,
John


.



Relevant Pages

  • Re: Just Saw Terminator, "ok" up till end, but oh that end.
    ... new Terminator was an appealing character (moreso than either John Connor ... Originally John died and Marcus took his place. ... endurance or data that a real Terminator would have. ...
    (rec.arts.movies.current-films)
  • Re: Linking to a .prn file
    ... I was able to modify the registry, and allow MS Access to link ... to .prn files. ... file extension switch locally. ... "John Nurick" wrote: ...
    (microsoft.public.access.externaldata)
  • Re: Terminator: The Sarah Connor Chronicles : "Dungeons & Dragons"
    ... original "Terminator" it was the teminator's job to alter the future, ... Sarah from the 'bot and second knocking her up with John himself. ... so while present day John and Sarah work to keep Skynet from ...
    (rec.arts.tv)
  • Re: Protecting a field within a form
    ... display the fields you don't want the users to be able to modify. ... "John Nurick" wrote: ... John Nurick ...
    (microsoft.public.access.gettingstarted)
  • Re: IIS ADMIN
    ... >> You don't have to give away the keys to the kingdom to administer IIS. ... You may need to modify ... The developer is making com components on the server. ...
    (microsoft.public.inetserver.iis.security)