A race condition occurs when two or more threads access shared data and try to do so at the same time.
The Heartbleed attack is a vulnerability in OpenSSL, where a Client sends heartbeat requests to a Server. The heartbeat requests can be of variable length, the length of the request is specified, however not checked for. Therefore when manipulating the size field of the heartbeat request, the server would return a reply that could be very long and therefore contain security relevant information.
Now, how on earth is this vulnerability related to two threads trying to access shared data at the same time? This question has been asked in one of our previous exams and I really cannot answer this. Can somebody help?
Also, very much related to this question is the following: Can type-safety prevent race-conditions? Type-safety basically means: The programmer is no longer in charge of memory management. And since race-conditions arise whenever two or more threads are trying to access shared memory, type-safety provides a way to at least minimize race-conditions, doesn't it?