Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2012-10-01 19:39:29 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-10-01 19:39:29 +0400
commit35ae7dae9ec8502bfca37f4ca4a0d176a73668d8 (patch)
tree5dac946ca69d5514d9290c2545149abe83a50bbb
parent4eb8bceaf82ea30782d7383ed94a0cb6f1b0e257 (diff)
fix for own bug in bmesh api, setting a byte string customdata layer assumed the input data was 256 length, assigning smaller values would read past the buffer.
-rw-r--r--source/blender/editors/transform/transform_conversions.c2
-rw-r--r--source/blender/python/bmesh/bmesh_py_types_customdata.c2
2 files changed, 3 insertions, 1 deletions
diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c
index 540cbb97609..39a5da94798 100644
--- a/source/blender/editors/transform/transform_conversions.c
+++ b/source/blender/editors/transform/transform_conversions.c
@@ -1489,6 +1489,8 @@ static void createTransCurveVerts(TransInfo *t)
count++;
tail++;
}
+
+ (void)hdata; /* quiet warning */
}
else if (propmode && head != tail) {
calc_distanceCurveVerts(head, tail - 1);
diff --git a/source/blender/python/bmesh/bmesh_py_types_customdata.c b/source/blender/python/bmesh/bmesh_py_types_customdata.c
index 2a9592d21e2..0391839c763 100644
--- a/source/blender/python/bmesh/bmesh_py_types_customdata.c
+++ b/source/blender/python/bmesh/bmesh_py_types_customdata.c
@@ -1079,7 +1079,7 @@ int BPy_BMLayerItem_SetItem(BPy_BMElem *py_ele, BPy_BMLayerItem *py_layer, PyObj
ret = -1;
}
else {
- BLI_strncpy(mstring->s, tmp_val, sizeof(mstring->s));
+ BLI_strncpy(mstring->s, tmp_val, MIN2(PyBytes_Size(py_value), sizeof(mstring->s)));
}
break;
}