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]

Re: src/winsup/cygwin ChangeLog autoload.cc autolo ...


Hi!

Thursday, 03 May, 2001 Christopher Faylor cgf@redhat.com wrote:

>>>>>2001-05-03  Egor Duda  <deo@logos-m.ru>
>>>>>
>>>>>        * fhandler_socket.cc (set_connect_secret): Use /dev/random to
>>>>>        generate secret cookie.
>>>>
>>>>What happens to the buf that you allocate here?  It looks like a memory
>>>>leak.
>>
>>CF> Just to be a little clearer:  It looks like a memory leak in execed proceses.
>>CF> ccalloced memory is copied to execed processes.
>>
>>ok. take 2.

CF> That looks better but I would prefer malloc/free rather than
CF> malloc/delete.

malloc/new/delete, not malloc/delete. delete assures that destructor
(if any) is called for entropy_source.

CF> Alternatively, you could make entropy_source part of fhandler_socket,
CF> ccalloc it, and cfree it in fhandler_socket destruction.  I guess this
CF> isn't right, though, since that would end up performing this operation
CF> once per every socket.

i think it's enough to have one entropy_source per process. i've also
removed calls to random(), since it's not good if random sequence is
changed when application calls bind(). Take 3.

Egor.            mailto:deo@logos-m.ru ICQ 5165414 FidoNet 2:5020/496.19

af_unix-crypto-random.diff

af_unix-crypto-random.ChangeLog


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