Commit graph

19 commits

Author SHA1 Message Date
Glenn Smith 751ccae12d Missed a couple +1s here and there 2018-03-07 00:44:46 -05:00
Glenn Smith a94587af43 Use strncpy instead of strcpy because again, buffer overflows 2018-03-06 02:35:33 -05:00
Glenn Smith 1728fe39ad Use strncat instead of strcat to prevent some buffer overflows 2018-03-06 00:48:44 -05:00
Areloch c2da755dc2 Fix for the directory scan for modules so it doesn't trim off characters in the path.
Resubmitted to clear the excess history entries.
2016-01-08 00:19:11 -06:00
Areloch 7a3b40a86d Initial Implementation of the Taml, Asset and Modules systems.
Only has example and shape assets currently.
2015-10-13 15:19:36 -05:00
Areloch bedc79aacb Merges in Monkey's fixes PR with a resolution for a conflict 2015-09-03 22:58:57 -05:00
Daniel Buckmaster c2e5dc3345 Merge remote-tracking branch 'bpay/clang-cl-build-fixes' into development
Conflicts:
	Engine/source/T3D/shapeBase.h
2015-07-17 16:55:12 +10:00
Ben Payne da4078c707 Fix passing of non-primitive types to varargs functions 2015-03-04 19:25:09 -05:00
Ben Payne eabff49a6a Fix buffer underrun found with address sanitizer
When subpath is the empty string, the code was reading from subPath[-1]
2015-03-04 19:13:49 -05:00
Nathan Bowhay 32e3678000 Fixed incorrect file size returned
According to
https://msdn.microsoft.com/en-us/library/windows/desktop/aa365740%28v=vs.85%29.aspx
to return the actual file size you need to use the high and low file
size.
2015-02-11 09:57:36 -08:00
Ben Payne fcf52fb5e0 Rename the memory allocating versions to make prev error less likely
The behavior is different enough that these shouldn't be overloaded
with the non-allocating verions. Also makes it more obvious what is
going on to the caller.
2015-01-26 16:52:06 -05:00
Ben Payne d669eb6ee7 Fix unintentionally deleted param 2015-01-26 16:52:05 -05:00
Ben Payne e3bbc42925 Provide a safer version of convertUTF16toUTF8 2015-01-26 16:52:01 -05:00
Ben Payne a88339c219 Fix buffer overflows due to incorrect use of sizeof
A snippet of example code:

UTF16 pszFilter[1024];
...
convertUTF8toUTF16((UTF8 *)mData.mFilters, pszFilter, sizeof(pszFilter));

Since the conversion function is expecting the third parameter to be the
length in 16-bit characters, *not* bytes, this results in the function
writing outside the bounds of the output array.

To make this less likely to happen in the future (I hope), I've provided a
template function that infers the correct size of a static array, so it's
no longer necessary to pass the size in most cases. The sized function has
been renamed with an "N" suffix to hopefully encourage this use.

This bug was caught due to a warning from MSVC about stack corruption
occurring in codeBlock::exec(), after opening a file open dialog twice in
succession. After some hunting, I found that this was due to
FileDialog::Execute() passing incorrect buffer sizes to the conversion
function, which resulted in the function writing a null terminator into
some memory that happened to be in the stack frame of codeBlock::exec()!
2015-01-26 16:52:01 -05:00
Daniel Buckmaster 1702573b78 Merge pull request #612 from GarageGames/platform-type-consistency
Platform type consistency
2014-05-10 11:40:40 +10:00
LuisAntonRebollo 4a17d6ceb0 Rename Status enum for avoid conficts on Linux. 2014-04-06 22:14:19 +02:00
cpusci 4c35fd37af Simple pass over the codebase to standardize the platform types. 2013-08-04 16:26:01 -05:00
Tim Newell 31036c4031 Bug fixes for alternative zip layout and define to toggle it on 2013-02-28 16:46:46 -05:00
DavidWyand-GG 7dbfe6994d Engine directory for ticket #1 2012-09-19 11:15:01 -04:00