AllocIf would overwrite memory if the .IF nesting became too deep.
git-svn-id: svn://svn.cc65.org/cc65/trunk@1389 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
@@ -70,7 +70,7 @@ enum {
|
||||
|
||||
/* One .IF descriptor */
|
||||
typedef struct IfDesc IfDesc;
|
||||
struct IfDesc {
|
||||
struct IfDesc {
|
||||
unsigned Flags; /* Bitmapped flags, see above */
|
||||
FilePos Pos; /* File position of the .IF */
|
||||
const char* Name; /* Name of the directive */
|
||||
@@ -89,7 +89,7 @@ static IfDesc* AllocIf (const char* Directive, int NeedTerm)
|
||||
|
||||
/* Check for stack overflow */
|
||||
if (IfCount >= MAX_IFS) {
|
||||
Error (ERR_IF_NESTING);
|
||||
Fatal (FAT_IF_NESTING);
|
||||
}
|
||||
|
||||
/* Alloc one element */
|
||||
|
||||
Reference in New Issue
Block a user