From 9648c6016b35a72aa23395f5d200e342df16490b Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 15 Sep 2011 11:49:36 +0000 Subject: 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. --- source/blender/blenlib/BLI_string.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source/blender/blenlib/BLI_string.h') diff --git a/source/blender/blenlib/BLI_string.h b/source/blender/blenlib/BLI_string.h index be77e18c24b..c53ce9dced5 100644 --- a/source/blender/blenlib/BLI_string.h +++ b/source/blender/blenlib/BLI_string.h @@ -144,6 +144,7 @@ void BLI_ascii_strtoupper(char *str, int len); /* string_utf8.c - may move these into their own header some day - campbell */ +char *BLI_strncpy_utf8(char *dst, const char *src, size_t maxncpy); int BLI_utf8_invalid_byte(const char *str, int length); int BLI_utf8_invalid_strip(char *str, int length); -- cgit v1.2.3