I think your patch would impose a cost of extra function call for every use 
of NULL_CHANNEL, which occurs pretty often. It would be better to put the 
global object that uses the RNG into a function instead (which sounds like 
what you would do anyway in your application code).

--------------------------------------------------
From: "Roman" <[email protected]>
Sent: Tuesday, March 31, 2009 7:58 AM
To: "Crypto++ Users" <[email protected]>
Subject: Segfault: Uninitialized NULL_CHANNEL

>
> Hi,
>
> while testing my program under MacOSX I have segmentation faults in
> the
> BufferedTransformation::ChannelPut2 function, while checking for an
> empty std:string.
>
> As I found out, that the reason is too early call somwehere in my code
> to the RandomNumberGenerator::GenerateBlock function, before the
> variable NULL_CHANNEL is initialized.
> This happens if I create a global object which uses the random number
> generator in it's constructor. (I have done that in my unit tests ...
> I would not do that in my application code ;) )
>
> How about writing a static function in BufferedTransformation with a
> static std::string to make sure of the correct initialization? Would
> you accept such a patch ?
>
>
> Cheers,
>
> Roman
> >
> 

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the "Crypto++ Users" 
Google Group.
To unsubscribe, send an email to [email protected].
More information about Crypto++ and this group is available at 
http://www.cryptopp.com.
-~----------~----~----~----~------~----~------~--~---

Reply via email to