Allow to terminate Recv/Send methods if fSSL was destroyed#270
Conversation
|
Checking for nil is not good enough, all it does is introduce a new race condition and doesn't address the root issue of the TIdSSLSocket object being freed while it is still actively being used. This same issue also affects TIdTCPServer, see #218. In that ticket, just closing the underlying socket without destroying the SSL object worked. A similar solution would likely apply here, too. |
|
it doesn't work for me. so We can add some variable like |
If the
Yes, I'm aware of that.
That would not work. If the |
|
I agree that an AV creates an unnecessary security risk in the library. However, I also agree that this AV is a consequence of anyother problem in the software itself. |
|
There is no security risk in an AV being raised. And there is really no difference in raising one type of exception versus another. I don't think checking for a nil SSL object is the right solution in this situation. It doesn't actually solve anything. |
I'm using
TIdHTTP/SSLin background thread.if I call
Postmethod, I have AV after callingDisconnectin main thread becauseTIdSSLSocketis destroyed butTIdSSLSocket.Sendis still executed ....call-stack (main thread) when TIdSSLSocket is freed:
AV in
TIdSSLSocket.SendbecausefSSLisnil:call-stack for this is
if we add checking for
nilforfSSLwe can avoid AV