Skip to content

Commit d9c4bfc

Browse files
committed
Disable completion in readline.
Fixes crash under unveil(), reported by James Turner.
1 parent bc685b8 commit d9c4bfc

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

oicb.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,8 @@ void proceed_cmd_result_end(char *msg, size_t len);
136136
void proceed_user_list(char *msg, size_t len);
137137
void proceed_group_list(char *msg, size_t len);
138138

139+
char *null_completer(const char *text, int state);
140+
139141
struct history_file *get_history_file(char *path);
140142
char *get_save_path_for(char type, const char *who);
141143
void save_history(char type, const char *who, const char *msg);
@@ -1012,6 +1014,11 @@ get_next_icb_msg(size_t *msglen) {
10121014
return (char*)(buf + 1);
10131015
}
10141016

1017+
char *
1018+
null_completer(const char *text, int state) {
1019+
return NULL;
1020+
}
1021+
10151022
__dead void
10161023
usage(const char *msg) {
10171024
if (msg)
@@ -1207,7 +1214,9 @@ main(int argc, char **argv) {
12071214

12081215
rl_callback_handler_install("", &proceed_user_input);
12091216
atexit(&rl_callback_handler_remove);
1210-
rl_bind_key(CTRL('t'), &siginfo_cmd);
1217+
1218+
// disable completion, or readline will try to access file system
1219+
rl_completion_entry_function = null_completer;
12111220

12121221
#ifdef SIGINFO
12131222
if (sigaction(SIGINFO, NULL, &sa) == -1)

0 commit comments

Comments
 (0)