mirror of
https://github.com/glest/glest-source.git
synced 2025-08-27 09:54:26 +02:00
Revert "g2xml.c:fix CWE-606:Unchecked Input for Loop Condition"
This reverts commit 5a49a4492e
.
Mathu is convinced this was a pointless and potentially detrimental patch ;)
This commit is contained in:
@@ -23,12 +23,7 @@
|
|||||||
#define FALSE 0
|
#define FALSE 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
|
||||||
* Set a boundary on the indexCount
|
|
||||||
* to prevent
|
|
||||||
* CWE-606: Unchecked Input for Loop Condition
|
|
||||||
*/
|
|
||||||
#define INDEX_COUNT_MAX 10000
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Forward function declarations.
|
* Forward function declarations.
|
||||||
@@ -316,10 +311,6 @@ int g3d2xml(FILE *infile, FILE *outfile) {
|
|||||||
|
|
||||||
/* read / write face indices */
|
/* read / write face indices */
|
||||||
nBytes = sizeof(uint32)*meshHeader.indexCount;
|
nBytes = sizeof(uint32)*meshHeader.indexCount;
|
||||||
if (meshHeader.indexCount > INDEX_COUNT_MAX) {
|
|
||||||
printf ("Index Count exceeds INDEX_COUNT_MAX (%u)\n", INDEX_COUNT_MAX);
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
idata = malloc(nBytes);
|
idata = malloc(nBytes);
|
||||||
if (idata == NULL) {
|
if (idata == NULL) {
|
||||||
printf("Could not allocate buffer!\n");
|
printf("Could not allocate buffer!\n");
|
||||||
|
Reference in New Issue
Block a user