win32 build and freeing pointers

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

win32 build and freeing pointers

Tobias.Wolf

Hi guys,

 

I’ve experienced the following strange behaviour.

I have the same code and the same openssl build.

With x64 everything I fine, but with x86 build not.

With a 32bit environment I got the following access vialotion.

I read that windows marks a freed pointer as “0XDDDDDDDD”, but we are usally freeing and setting NULL value to a pointer, therefore a following NULL check later for a already freed pointer would NOT work, right?

Has anybody an adivice for me?

 

Regards

Tobias

 

 

Reply | Threaded
Open this post in threaded view
|

Re: win32 build and freeing pointers

Dan Kegel-2
Sounds like the pointer is *pointing to* memory containing 0xdddddddd...
i.e. this is a use-after-free error.

You might consider building your app with Address Sanitizer enabled,
that might find the problem earlier during execution.
- Dan

On Fri, Jul 31, 2020 at 5:32 AM <[hidden email]> wrote:

Hi guys,

 

I’ve experienced the following strange behaviour.

I have the same code and the same openssl build.

With x64 everything I fine, but with x86 build not.

With a 32bit environment I got the following access vialotion.

I read that windows marks a freed pointer as “0XDDDDDDDD”, but we are usally freeing and setting NULL value to a pointer, therefore a following NULL check later for a already freed pointer would NOT work, right?

Has anybody an adivice for me?

 

Regards

Tobias