diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-07-15 09:09:06 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-07-15 09:09:06 +0400 |
commit | 2b6f35d686a35a347aec93cae2f018b1f7312834 (patch) | |
tree | 1e76ab3688a3470aa1103804135387868ec80306 /source/blender/editors | |
parent | 02f5b0fc08e979dab65a7bc1ee0383098ac99b2e (diff) |
fix for error in string copy
- BLI_strncpy_wchar_from_utf8 wasn't NULL terminating the destination string, caused uninitialized memory use in BPY_python_start().
- BLI_strncpy_wchar_as_utf8 could write one byte past the buffer bounds.
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/curve/editfont.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/source/blender/editors/curve/editfont.c b/source/blender/editors/curve/editfont.c index 5b2cc49d106..a04c3fc3c8f 100644 --- a/source/blender/editors/curve/editfont.c +++ b/source/blender/editors/curve/editfont.c @@ -380,7 +380,7 @@ static int paste_file(bContext *C, ReportList *reports, const char *filename) if (cu->len + filelen < MAXTEXT) { int tmplen; - wchar_t *mem = MEM_callocN((sizeof(wchar_t) * filelen) + (4 * sizeof(wchar_t)), "temporary"); + wchar_t *mem = MEM_mallocN((sizeof(wchar_t) * filelen) + (4 * sizeof(wchar_t)), "temporary"); tmplen = BLI_strncpy_wchar_from_utf8(mem, strp, filelen + 1); wcscat(ef->textbuf, mem); MEM_freeN(mem); |