Skip to content

Commit e75ed52

Browse files
committed
fix #639: Use memcpy() to copy downloaded asset data
1 parent ea25bb5 commit e75ed52

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/project_p.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ bool ProjectPrivate::tryLoad(IProjectReader *reader)
122122
for (size_t i = 0; i < assets.size(); i++) {
123123
const std::string &data = assetData[i];
124124
char *ptr = (char *)malloc(data.size() * sizeof(char));
125-
strncpy(ptr, data.data(), data.size());
125+
memcpy(ptr, data.data(), data.size() * sizeof(char));
126126
assets[assetNames[i]]->setData(data.size(), ptr);
127127
}
128128

0 commit comments

Comments
 (0)