diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-10-01 19:39:29 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-10-01 19:39:29 +0400 |
commit | 35ae7dae9ec8502bfca37f4ca4a0d176a73668d8 (patch) | |
tree | 5dac946ca69d5514d9290c2545149abe83a50bbb /source/blender/python | |
parent | 4eb8bceaf82ea30782d7383ed94a0cb6f1b0e257 (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.
Diffstat (limited to 'source/blender/python')
-rw-r--r-- | source/blender/python/bmesh/bmesh_py_types_customdata.c | 2 |
1 files changed, 1 insertions, 1 deletions
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; } |