On Tue, Oct 08, 2002 at 11:07:53AM -0400, Luc Bergeron wrote:
>      HashVerifier *pVerifier = new HashVerifier(SHAhash);
>     
>      pVerifier->Put(digest, digest.Size());
>      StringSource(ClearTextPwd.c_str(), true, pVerifier);

This StringSource is a temporary object, and it goes away at the end of 
the statement, deleting pVerifier. Do this instead:

StringSource source(ClearTextPwd.c_str(), true, pVerifier);

This way the source object stays alive until the end of the scope.

>      if (pVerifier->GetLastResult())

At this point pVerifier is no longer pointing to a valid object. I'm
surprised you didn't hit a memory access violation, segmentation fault, or
something like that.

Reply via email to