jtsiomb / kdtree

A simple C library for working with KD-Trees
http://nuclear.mutantstargoat.com/sw/kdtree/
Other
395 stars 115 forks source link

kd_insertf causes segfault with less then 16 dimensions #3

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Use of kd_insertf with less then 16 dimensions

What version of the product are you using? On what operating system?
0.5.4

Please provide any additional information below.

buf is not set in the path where dim <= 16

Fix:
Line 231:
bptr = buf = sbuf;

Original issue reported on code.google.com by Wiza...@gmail.com on 29 May 2009 at 6:42

GoogleCodeExporter commented 9 years ago
This fix worked for me on the same version, but the relevant line was 192 in 
kdtree.c.

Original comment by m...@1ec5.org on 5 Jun 2009 at 5:05

GoogleCodeExporter commented 9 years ago
That's correct, I don't know where I got 231 from.

Original comment by Wiza...@gmail.com on 8 Jun 2009 at 7:13

GoogleCodeExporter commented 9 years ago
there is a similar problem for kd_nearest_range()

Original comment by haom...@gmail.com on 16 Nov 2009 at 5:12

GoogleCodeExporter commented 9 years ago
Patch against 0.5.5 attached.

Original comment by Wiza...@gmail.com on 1 Feb 2010 at 2:57

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks for reporting, commited a fix.

Original comment by jtsi...@gmail.com on 25 Nov 2011 at 12:06