summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2017-06-03 13:41:49 +0200
committerSébastien Helleu <flashcode@flashtux.org>2017-06-03 13:41:49 +0200
commitda8f19bcee8e59d9b9e4d392d7d0067988503b7f (patch)
tree5400591ce447a5bc42df73fd87b4b0cc693e8534
parent240a2fc2ca70bdef1088ebc91735ab8a636455a4 (diff)
downloadweechat-da8f19bcee8e59d9b9e4d392d7d0067988503b7f.zip
core: fix infinite loop when the terminal is closed on the secure password prompt (closes #1010)
-rw-r--r--ChangeLog.adoc1
-rw-r--r--src/gui/curses/gui-curses-main.c4
2 files changed, 3 insertions, 2 deletions
diff --git a/ChangeLog.adoc b/ChangeLog.adoc
index 711896377..58158125c 100644
--- a/ChangeLog.adoc
+++ b/ChangeLog.adoc
@@ -32,6 +32,7 @@ Improvements::
Bug fixes::
+ * core: fix infinite loop when the terminal is closed on the secure password prompt (issue #1010)
* buflist: fix long mouse gestures
* buflist: fix slow switch of buffer when there are a lot of buffers opened (issue #998)
* buflist: add option "bar" in command /buflist, do not automatically add the "buflist" bar when the option buflist.look.enabled is off (issue #994)
diff --git a/src/gui/curses/gui-curses-main.c b/src/gui/curses/gui-curses-main.c
index 32e953691..ade0a9878 100644
--- a/src/gui/curses/gui-curses-main.c
+++ b/src/gui/curses/gui-curses-main.c
@@ -104,8 +104,8 @@ gui_main_get_password (const char **prompt, char *password, int size)
/* enter */
if (ch == '\n')
break;
- /* ctrl-C */
- if (ch == 3)
+ /* terminal lost or ctrl-C */
+ if ((ch == ERR) || (ch == 3))
{
password[0] = 3;
i = 1;