[ODE] Small memory bug in gimpact

Chunky Kibbles chunky at icculus.org
Tue Nov 20 00:05:42 MST 2007


Heya, I'm fairly certain this qualifies as a bug in gimpact.

In gim_memory.cpp [in ODE 0.9], lines118-129:
void * gim_alloc(size_t size)
{
	void * ptr = 0;
	ptr = malloc(size);
	/*if (g_allocfn) ptr = g_allocfn(size); else ptr = * malloc(size);//_mm_malloc(size,0);*/
	if(ptr==0)
	{
		float * fp = 0;
		*fp = 0.0f;
	}
	return ptr;
}

That *fp=0.0f is always assigning a value to the memory pointed to by
a a null pointer, which throws an exception here.

Thanks,
Gary (-;


More information about the ODE mailing list