Be a little more conservative with some string operations.
This should hopefully fix #531, though in practice the previous code should have been safe too.
This commit is contained in:
+1
-1
@@ -241,7 +241,7 @@ char* readBuiltInModule(const char* name)
|
||||
|
||||
size_t length = strlen(*module->source);
|
||||
char* copy = (char*)malloc(length + 1);
|
||||
strncpy(copy, *module->source, length + 1);
|
||||
memcpy(copy, *module->source, length + 1);
|
||||
return copy;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user