thegenemyers / DAMAPPER

Long read to reference genome mapping tool
Other
13 stars 9 forks source link

Memory allocation bug? #6

Closed gt1 closed 7 years ago

gt1 commented 7 years ago

In map.c line 2595 (see https://github.com/thegenemyers/DAMAPPER/blob/master/map.c#L2595 ) there is

part = Malloc(sizeof(Zones )COmax,"Allocating zones vector");

which I think should be

part = Malloc(sizeof(Zones)*COmax,"Allocating zones vector");

as part is of type Zones * .

Could you please check?

Thanks German

thegenemyers commented 7 years ago

Yes, it is a bug. The Realloc of part involves sizeof(Zones) so it would definitely induce a segfault. I have made the edit and pushed the change. -- Gene

On 1/26/17, 1:03 PM, German Tischler wrote:

In map.c line 2595 (see https://github.com/thegenemyers/DAMAPPER/blob/master/map.c#L2595 ) there is

part = Malloc(sizeof(Zones )COmax,"Allocating zones vector");

which I think should be

part = Malloc(sizeof(Zones)*COmax,"Allocating zones vector");

as part is of type Zones * .

Could you please check?

Thanks German

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/thegenemyers/DAMAPPER/issues/6, or mute the thread https://github.com/notifications/unsubscribe-auth/AGkkNrYvif8282wbUrNDyWGdv4FW1Mluks5rWIuPgaJpZM4LukL6.

gt1 commented 7 years ago

Thank you. German