Re: Crash when starting Project Monitor
Stefan via TortoiseSVN-dev <[email protected]> Fri, 7 Mar 2025 04:41:38 -0800 (PST)
| Newsgroups | gmane.comp.version-control.subversion.tortoisesvn.devel |
|---|---|
| Message-ID | <[email protected]> |
------=_Part_49396_1086787720.1741351298128 Content-Type: multipart/alternative; boundary="----=_Part_49397_2104430491.1741351298128" ------=_Part_49397_2104430491.1741351298128 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thursday, March 6, 2025 at 1:58:16=E2=80=AFPM UTC+1 [email protected]= m wrote: Hi, I've encountered a crash when starting Project Monitor (or probably rather= =20 when it does the first check of the monitored repos). I've debugged it and the crash occurs in LogDlg.Cpp: =20 callback->SetAuthData(CStringUtils::Decrypt(item.userName).get(),=20 CStringUtils::Decrypt(item.password).get()); From what I can tell, the call to CryptUnprotectData fails, returning a=20 nullptr and the call to .get() above fails. if (CryptUnprotectData(&blobIn, &descr, nullptr, nullptr, nullptr,=20 CRYPTPROTECT_UI_FORBIDDEN, &blobOut) =3D=3D FALSE) return nullptr; =20 returning a nullptr when the method is declared to return an=20 std::unique_ptr returns an empty unique_ptr. So calling .get() will never= =20 crash. but, unlike CString which one can assign a nullptr, one can not assign a=20 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= =20 assign a nullptr to a CString. Committed the fix in r29751 Stefan --=20 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 e= mail to [email protected]. To view this discussion visit https://groups.google.com/d/msgid/tortoisesvn= -dev/48d96b05-5e84-43a3-b863-6e80da2ddd7fn%40googlegroups.com. ------=_Part_49397_2104430491.1741351298128 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <br /><br /><div><div dir=3D"auto">On Thursday, March 6, 2025 at 1:58:16=E2= =80=AFPM UTC+1 [email protected] wrote:<br /></div><blockquote style=3D= "margin: 0px 0px 0px 0.8ex; border-left: 1px solid rgb(204, 204, 204); padd= ing-left: 1ex;">Hi,<div><br /></div><div>I've encountered a crash when star= ting Project Monitor (or probably rather when it does the first check of th= e monitored repos).</div><div><br /></div><div>I've debugged it and the cra= sh occurs in LogDlg.Cpp:</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 callback->SetAuthData(CStringUtils::Decrypt(item.userN= ame).get(), CStringUtils::Decrypt(item.password).get());</div><div><br /></= div><div>From what I can tell, the call to CryptUnprotectData fails, return= ing a nullptr and the call to .get() above fails.</div><div>=C2=A0 =C2=A0 i= f (CryptUnprotectData(&blobIn, &descr, nullptr, nullptr, nullptr, C= RYPTPROTECT_UI_FORBIDDEN, &blobOut) =3D=3D FALSE)<br />=C2=A0 =C2=A0 = =C2=A0 =C2=A0 return nullptr;<br /></div></blockquote><div>=C2=A0</div><div= ><div>returning a nullptr when the method is declared to return an std::uni= que_ptr returns an empty unique_ptr. So calling .get() will never crash.</d= iv><div>but, unlike CString which one can assign a nullptr, one can not ass= ign a nullptr to an std string. So only that will crash.</div></div><div><b= r /></div><div>I took only part of your patch because as mentioned it's per= fectly fine to assign a nullptr to a CString.</div><div>Committed the fix i= n r29751</div><div><br /></div><div>Stefan</div></div> <p></p> -- <br /> You received this message because you are subscribed to the Google Groups &= quot;TortoiseSVN-dev" group.<br /> To unsubscribe from this group and stop receiving emails from it, send an e= mail to <a href=3D"mailto:[email protected]">tor= [email protected]</a>.<br /> To view this discussion visit <a href=3D"https://groups.google.com/d/msgid/= tortoisesvn-dev/48d96b05-5e84-43a3-b863-6e80da2ddd7fn%40googlegroups.com?ut= m_medium=3Demail&utm_source=3Dfooter">https://groups.google.com/d/msgid/tor= toisesvn-dev/48d96b05-5e84-43a3-b863-6e80da2ddd7fn%40googlegroups.com</a>.<= br /> ------=_Part_49397_2104430491.1741351298128-- ------=_Part_49396_1086787720.1741351298128--