Subject: | Random strings in fetching array from Kdb |
There is a bug in ./accessors-c.inc" on line 442, which reads:
CS(KC, av_push(av, newSVpv((const char*)kC(x),x->n)))
it should read:
CS(KC, av_push(av, newSVpvn((const char*)kC(x),x->n)))
the second argument to newSVpv is the length of the string pointed to by
the first, but if this is 0 it means the length should be auto
determined by looking for the null terminator. This does not work well
and we found random strings in our results. The newSVpvn function does
take the second argument always as length, so 0 results in a correctly
empty string.
There are a few other newSVpv uses with computed length, I'll check if
they are troublesome as well.