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>2010-01-26 14:29:39 +0300
committerCampbell Barton <ideasman42@gmail.com>2010-01-26 14:29:39 +0300
commit009304523e6a4240f49cbb609f2820f70ebfdb2c (patch)
tree57c4a043704ee16099c01967242982940600e758 /source/blender/blenkernel/intern/text.c
parent4efed2351710e1d726aa869bc5e7a41c0a1cac8b (diff)
bugfix [#20674] SegFault from console 'c = data.texts["text1"].copy()'
Diffstat (limited to 'source/blender/blenkernel/intern/text.c')
-rw-r--r--source/blender/blenkernel/intern/text.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/text.c b/source/blender/blenkernel/intern/text.c
index e948ffdbaf2..1eea035ec2c 100644
--- a/source/blender/blenkernel/intern/text.c
+++ b/source/blender/blenkernel/intern/text.c
@@ -431,9 +431,15 @@ Text *copy_text(Text *ta)
tan= copy_libblock(ta);
- tan->name= MEM_mallocN(strlen(ta->name)+1, "text_name");
- strcpy(tan->name, ta->name);
-
+ /* file name can be NULL */
+ if(ta->name) {
+ tan->name= MEM_mallocN(strlen(ta->name)+1, "text_name");
+ strcpy(tan->name, ta->name);
+ }
+ else {
+ tan->name= NULL;
+ }
+
tan->flags = ta->flags | TXT_ISDIRTY;
tan->lines.first= tan->lines.last= NULL;