Commit graph

105 commits

Author SHA1 Message Date
RichardRanft 6c9cff4c68 Update str.cpp
Fixed copy/paste error - now actually checks the parameter passed in....
2015-05-31 20:42:05 -07:00
RichardRanft 38413be513 Update str.cpp
Effectively copied dStrIsEmtpy() into String::isEmpty().
2015-05-24 22:43:27 -07:00
RichardRanft 3ddd9b8a4c Add static String::isEmpty(const char*) method and use it to verify path for Forest::saveDataFile() is not empty. 2015-05-06 15:39:02 -07:00
Azaezel 6201e48501 crash out on net stream leaks.
causes a fatal assertion when bitstream is passed an int value it cannot transmit given the provided bit length, and reports what the value and count were, respectively
2015-04-26 20:25:40 -05:00
Daniel Buckmaster 84e8cbb4ee Revert recent style cleanup changes. 2015-03-04 11:58:36 +11:00
Daniel Buckmaster 33fcc59543 Merge remote-tracking branch 'origin/style-cleanup' into development
Conflicts:
	Engine/source/T3D/tsStatic.cpp
	Engine/source/console/compiledEval.cpp
	Engine/source/ts/tsMesh.cpp
	Engine/source/ts/tsShape.cpp
2015-03-01 22:30:22 +11:00
Ben Payne f67a0353d0 Review fixes 2015-02-23 14:57:37 -05:00
Ben Payne 55ac3dca70 Fix assignment operator 2015-02-20 18:42:30 -05:00
Ben Payne 591253d5b5 Fix missing va_end's 2015-02-20 18:42:29 -05:00
Ben Payne 0ffd7f5620 Fix member vars left uninitialized in constructors 2015-02-20 18:41:51 -05:00
Ben Payne 47950382f7 ...and update the profiler strings 2015-01-26 16:52:07 -05: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 6e45643b28 Add descriptions 2015-01-26 16:52:04 -05:00
Ben Payne 2cc4801974 Remove a dead function 2015-01-26 16:52:03 -05:00
Ben Payne 7613fa0375 Remove unnecessary null termination
UTF16Cache::copyToBuffer() is already adding a null terminator
2015-01-26 16:52:02 -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
Luis Anton Rebollo 6492028bb2 Merge pull request #1035 from bpay/memfixes
Memfixes
2015-01-25 13:42:32 +01:00
Luis Anton Rebollo 79df1a1b3a Merge pull request #1089 from eightyeight/profile-stringtable
Add profiler regions for StringTable functions
2015-01-25 10:56:20 +01:00
LuisAntonRebollo 4e9034854d Linux implementation. Include changes for gcc x64. 2015-01-24 22:08:26 +01:00
LuisAntonRebollo 3336bffad2 Changes for Linux. 2015-01-19 01:44:36 +01:00
Daniel Buckmaster 40b871e652 Add profiling to StringTable. 2014-12-29 20:20:00 +11:00
Daniel Buckmaster ae284a89ec Merge branch 'development' into defineconsolemethod
Conflicts:
	Engine/source/materials/materialDefinition.cpp
2014-12-26 13:22:16 +11:00
Daniel Buckmaster 3ab048c5b0 Fixes after feedback from Luis.
* Made use of dStrIsEmpty in more locations (and fixed it :P)
 * Removed commented-out code
 * Corrected default params
 * Fixed some console warning formats
 * Removed tabs
 * Corrected setExtent API
2014-12-23 18:48:02 +11:00
Daniel Buckmaster 03f71a78c0 Added dStrIsEmpty and replaced some incorrect string comparisons. 2014-12-21 21:25:19 +11:00
Daniel Buckmaster 9396ae7176 Merge remote-tracking branch 'Winterleaf/Development-Console' into defineconsolemethod
Conflicts:
	Engine/source/T3D/missionMarker.cpp
2014-12-21 21:23:55 +11:00
Daniel Buckmaster 33ff180593 Merge branch 'development' into style-cleanup
Conflicts:
	Engine/source/console/astNodes.cpp
	Engine/source/console/codeBlock.cpp
	Engine/source/console/compiledEval.cpp
	Engine/source/ts/collada/colladaAppMesh.cpp
	Engine/source/ts/tsShape.cpp
	Engine/source/ts/tsShapeConstruct.cpp
2014-12-15 12:15:55 +11:00
Ben Payne 50238fb2ac Casts are stronger than necessary 2014-12-13 16:08:46 -05:00
Ben Payne d97d44f66f Fix more misc uninitialized vars 2014-12-11 18:25:29 -05:00
Ben Payne a10e6e99d4 Fix read past end of array 2014-12-11 18:22:14 -05:00
Anis ab31f9b212 clamp value fix on vorbis decoding 2014-11-29 00:00:41 +01:00
Vincent Gee a849202bde Added Sanity Check for out of memory 2014-11-04 06:49:09 -05:00
Vincent Gee acb192e2a5 Replaced a ton of ConsoleMethods with the DefineConsoleMethod Macro. 2014-11-03 22:42:51 -05:00
Daniel Buckmaster 81a385094f Merge pull request #842 from eightyeight/console-func-refactor
jamesu's console function refactor
2014-10-24 00:42:58 +11:00
Daniel Buckmaster 2f416290ab Merge pull request #788 from eightyeight/return-status-code
Allow return status to be specified using quitWithStatus
2014-10-24 00:31:05 +11:00
Daniel Buckmaster b507dc9555 Merge branch 'master' into console-func-refactor
Conflicts:
	Engine/source/app/net/net.cpp
	Engine/source/console/astNodes.cpp
	Engine/source/console/compiledEval.cpp
	Engine/source/console/console.h
	Engine/source/console/consoleInternal.h
	Engine/source/console/engineAPI.h
2014-10-14 15:09:11 +11:00
LuisAntonRebollo 535f56af6e Merge pull request #801 from eightyeight/gtest-tests
Googletest tests
2014-10-02 01:31:13 +02:00
Daniel Buckmaster bedde94a9f Removed all local type definitions for GCC. 2014-09-29 14:31:07 +10:00
Daniel Buckmaster 178484ca6a Moved zip tests and commented them out :(. 2014-09-29 11:38:37 +10:00
Daniel Buckmaster 9f47032522 Allow return status to be specified using quitWithStatus. 2014-09-24 09:24:29 +10:00
LuisAntonRebollo fcf7bee64a Fix x64 problems for WIN64. 2014-09-14 21:42:51 +02:00
Daniel Buckmaster 5a430af051 Merge remote-tracking branch 'gg/development' into gtest-tests 2014-08-30 17:51:41 +10:00
Daniel Buckmaster 4110fe51b2 Fixed thread statics. 2014-08-20 10:00:46 +10:00
Daniel Buckmaster 5f42f63078 Fixed dates. 2014-08-09 11:31:29 +10:00
Daniel Buckmaster 5c6d22a059 Ported process and journal tests. 2014-08-03 21:20:18 +10:00
Daniel Buckmaster 552cb87770 Ported FixedSizeDeque test. 2014-07-17 10:22:02 +02:00
Daniel Buckmaster 18c5c25297 Ported path test. 2014-07-15 23:57:02 +02:00
Daniel Buckmaster 3cdfcb19d4 Ported string tests. 2014-07-15 14:46:27 +02:00
Daniel Buckmaster 2f2d7cf388 Ported swizzle test. 2014-07-15 14:12:31 +02:00
Daniel Buckmaster 7555f1d2cc Merge branch 'development' into gtest-tests 2014-07-13 20:07:03 +02:00