I haven't investigated much, but valgrind is complaining about some non-null-terminated strings coming out from WKBWriter::writeHEX.
I guess it _might_ be expected, given writeHEX takes a size_t output parameter, but wanted to make sure this is the case. I find it pretty useless for an HEX-returning function to skip null-termination (let alone return by unsigned char*). But this is another story. So, question is: are gstrdup and gstrdup_s functions in geos_ts.cpp intended to include or not a null termination ? Note that gstrdup_s takes a size but reads one more byte from input pointer: char* gstrdup_s(const char* str, const std::size_t size) { char* out = static_cast<char*>(std::malloc(size + 1)); if (0 != out) { // as no strlen call necessary, memcpy may be faster than strcpy std::memcpy(out, str, size + 1); ^^^^^^^^^^^^^^^^^ HERE ^^^^^^^^^ } assert(0 != out); return out; } --strk; () Free GIS & Flash consultant/developer /\ http://strk.keybit.net/services.html _______________________________________________ geos-devel mailing list geos-devel@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/geos-devel