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>2011-09-15 15:49:36 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-09-15 15:49:36 +0400
commit9648c6016b35a72aa23395f5d200e342df16490b (patch)
treee9e5184d1039db277ff45ca162b621f2bad8b861 /source/blender/makesrna/intern/rna_ID.c
parent86d05b31446d8960679ece640089474afe5577d9 (diff)
fix [#28658] python can assign non utf8 and crash because of string lenth limits.
add BLI_strncpy_utf8() which which ensures there are no partially copied UTF8 characters, limited by the buffer size.
Diffstat (limited to 'source/blender/makesrna/intern/rna_ID.c')
-rw-r--r--source/blender/makesrna/intern/rna_ID.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/source/blender/makesrna/intern/rna_ID.c b/source/blender/makesrna/intern/rna_ID.c
index 82217cdc3e4..05786cedeac 100644
--- a/source/blender/makesrna/intern/rna_ID.c
+++ b/source/blender/makesrna/intern/rna_ID.c
@@ -99,7 +99,7 @@ int rna_ID_name_length(PointerRNA *ptr)
void rna_ID_name_set(PointerRNA *ptr, const char *value)
{
ID *id= (ID*)ptr->data;
- BLI_strncpy(id->name+2, value, sizeof(id->name)-2);
+ BLI_strncpy_utf8(id->name+2, value, sizeof(id->name)-2);
test_idbutton(id->name+2);
}