fredag 7 mars 2025 kl. 13:41:38 UTC+1 skrev Stefan:

On Thursday, March 6, 2025 at 1:58:16 PM UTC+1 [email protected] wrote:

Hi,

I've encountered a crash when starting Project Monitor (or probably rather 
when it does the first check of the monitored repos).

I've debugged it and the crash occurs in LogDlg.Cpp:
                
callback->SetAuthData(CStringUtils::Decrypt(item.userName).get(), 
CStringUtils::Decrypt(item.password).get());

>From what I can tell, the call to CryptUnprotectData fails, returning a 
nullptr and the call to .get() above fails.
    if (CryptUnprotectData(&blobIn, &descr, nullptr, nullptr, nullptr, 
CRYPTPROTECT_UI_FORBIDDEN, &blobOut) == FALSE)
        return nullptr;

 
returning a nullptr when the method is declared to return an 
std::unique_ptr returns an empty unique_ptr. So calling .get() will never 
crash.
but, unlike CString which one can assign a nullptr, one can not assign a 
nullptr to an std string. So only that will crash.

I took only part of your patch because as mentioned it's perfectly fine to 
assign a nullptr to a CString.
Committed the fix in r29751

Stefan


Great, thanks for the explanation!

Daniel 

-- 
You received this message because you are subscribed to the Google Groups 
"TortoiseSVN-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/tortoisesvn-dev/291edec5-a378-49b6-9c5e-89d00ded83e2n%40googlegroups.com.

Reply via email to