mirror of
https://git.code.sf.net/p/mingw-w64/mingw-w64
synced 2024-11-23 01:44:43 +08:00
widl: Increase max import depth.
Backport from Wine commit ba6b020b9f792539f4004ec93932231715e90051 Fixes segfault, e.g. while generating dxgi1_6.h
This commit is contained in:
parent
be4c85af5f
commit
f4fb3ad87e
@ -76,7 +76,7 @@ static int cbufalloc = 0;
|
||||
static int kw_token(const char *kw);
|
||||
static int attr_token(const char *kw);
|
||||
|
||||
#define MAX_IMPORT_DEPTH 10
|
||||
#define MAX_IMPORT_DEPTH 20
|
||||
struct {
|
||||
YY_BUFFER_STATE state;
|
||||
char *input_name;
|
||||
@ -517,6 +517,9 @@ int do_import(char *fname)
|
||||
else if (!(path = wpp_find_include( fname, input_name )))
|
||||
error_loc("Unable to open include file %s\n", fname);
|
||||
|
||||
if (import_stack_ptr == MAX_IMPORT_DEPTH)
|
||||
error_loc("Exceeded max import depth\n");
|
||||
|
||||
import_stack[ptr].temp_name = temp_name;
|
||||
import_stack[ptr].input_name = input_name;
|
||||
import_stack[ptr].line_number = line_number;
|
||||
|
@ -743,7 +743,7 @@ static int cbufalloc = 0;
|
||||
static int kw_token(const char *kw);
|
||||
static int attr_token(const char *kw);
|
||||
|
||||
#define MAX_IMPORT_DEPTH 10
|
||||
#define MAX_IMPORT_DEPTH 20
|
||||
struct {
|
||||
YY_BUFFER_STATE state;
|
||||
char *input_name;
|
||||
@ -2628,6 +2628,9 @@ int do_import(char *fname)
|
||||
else if (!(path = wpp_find_include( fname, input_name )))
|
||||
error_loc("Unable to open include file %s\n", fname);
|
||||
|
||||
if (import_stack_ptr == MAX_IMPORT_DEPTH)
|
||||
error_loc("Exceeded max import depth\n");
|
||||
|
||||
import_stack[ptr].temp_name = temp_name;
|
||||
import_stack[ptr].input_name = input_name;
|
||||
import_stack[ptr].line_number = line_number;
|
||||
|
Loading…
Reference in New Issue
Block a user