diff options
Diffstat (limited to 'gcc/cpplib.c')
-rw-r--r-- | gcc/cpplib.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/cpplib.c b/gcc/cpplib.c index 60a86e3e398..298f5e6618b 100644 --- a/gcc/cpplib.c +++ b/gcc/cpplib.c @@ -680,6 +680,14 @@ do_include_common (cpp_reader *pfile, enum include_type type) if (!fname) return; + if (!*fname) + { + cpp_error (pfile, CPP_DL_ERROR, "empty filename in #%s", + pfile->directive->name); + free ((void *) fname); + return; + } + /* Prevent #include recursion. */ if (pfile->line_maps.depth >= CPP_STACK_MAX) cpp_error (pfile, CPP_DL_ERROR, "#include nested too deeply"); |