commit c9d7d4aa
Fixed a buffer over read while writing files
Changed files
| M | source/code/sago/SagoMisc.cpp before |
diff --git a/source/code/sago/SagoMisc.cpp b/source/code/sago/SagoMisc.cpp
index 83d8998..065631a 100644
--- a/source/code/sago/SagoMisc.cpp
+++ b/source/code/sago/SagoMisc.cpp
@@ -81,7 +81,7 @@ void WriteFileContent(const char* filename, const std::string& content) {
cerr << "Failed to open file for writing, " << PHYSFS_getLastError() << endl;
return;
}
- PHYSFS_write(myfile, content.c_str(), 1, content.length()+1);
+ PHYSFS_write(myfile, content.c_str(), sizeof(char), content.length());
PHYSFS_close(myfile);
}