aboutsummaryrefslogtreecommitdiff
path: root/readline/readline.c
diff options
context:
space:
mode:
authorStu Grossman <grossman@cygnus>1992-02-21 07:28:31 +0000
committerStu Grossman <grossman@cygnus>1992-02-21 07:28:31 +0000
commit77219de22db033d9ca721f5934caa08cad19193d (patch)
treeb690068b51e73df1fe2bf7b07ff0f6d2cf02e62f /readline/readline.c
parent73afbe2809cd21cbc6c2f8c140cff2b6305462f5 (diff)
downloadgdb-77219de22db033d9ca721f5934caa08cad19193d.zip
gdb-77219de22db033d9ca721f5934caa08cad19193d.tar.gz
gdb-77219de22db033d9ca721f5934caa08cad19193d.tar.bz2
* readline.c (rl_read_init_file): Make sure that null filename is
not passed to open() or else we end up opening the directory, and read a bunch of garbage into keymap[].
Diffstat (limited to 'readline/readline.c')
-rw-r--r--readline/readline.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/readline/readline.c b/readline/readline.c
index cfe0fec..a1b4a53 100644
--- a/readline/readline.c
+++ b/readline/readline.c
@@ -5484,6 +5484,9 @@ rl_read_init_file (filename)
openname = tilde_expand (filename);
+ if (!openname || *openname == '\000')
+ return ENOENT;
+
if ((stat (openname, &finfo) < 0) ||
(file = open (openname, O_RDONLY, 0666)) < 0)
{