Changeset: 099f8be737b1 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=099f8be737b1
Modified Files:
sql/backends/monet5/UDF/pyapi/type_conversion.c
Branch: default
Log Message:
Strings have a null terminator.
diffs (21 lines):
diff --git a/sql/backends/monet5/UDF/pyapi/type_conversion.c
b/sql/backends/monet5/UDF/pyapi/type_conversion.c
--- a/sql/backends/monet5/UDF/pyapi/type_conversion.c
+++ b/sql/backends/monet5/UDF/pyapi/type_conversion.c
@@ -107,7 +107,7 @@ str pyobject_to_blob(PyObject **ptr, siz
goto wrapup;
}
- *value = GDKmalloc(sizeof(blob) + size);
+ *value = GDKmalloc(sizeof(blob) + size + 1);
if (!*value) {
msg = createException(MAL, "pyapi.eval", MAL_MALLOC_FAIL);
goto wrapup;
@@ -134,7 +134,7 @@ str pyobject_to_str(PyObject **ptr, size
utf8_string = *value;
if (!utf8_string) {
- utf8_string = (str)malloc(pyobject_get_size(obj) *
sizeof(char));
+ utf8_string = (str)malloc(pyobject_get_size(obj) * sizeof(char)
+ 1);
if (!utf8_string) {
msg = createException(MAL, "pyapi.eval",
MAL_MALLOC_FAIL "python string");
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list