git repos / blockattack-game

commit c9d7d4aa

sago007 · 2016-04-30 09:20
c9d7d4aa73a3cdc158787b4ca8ff65bfa4f09087 patch · browse files
parent d9476292c1a9546bd14774eb82eb2afff8d8044c

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);
}