aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJethro Grassie <jtg@xtrabass.com>2019-01-12 01:50:59 -0500
committerJethro Grassie <jtg@xtrabass.com>2019-01-21 01:57:14 -0500
commitca86ef1bebeb39bf0b8c52fc2a2f35964d4cdde8 (patch)
treebfd0cfef89a23c6a8650e428c234aad2076af48b
parentMerge pull request #5008 (diff)
downloadmonero-ca86ef1bebeb39bf0b8c52fc2a2f35964d4cdde8.tar.xz
readline: don't dereference possible NULL pointer
-rw-r--r--contrib/epee/src/readline_buffer.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/contrib/epee/src/readline_buffer.cpp b/contrib/epee/src/readline_buffer.cpp
index c5949da0a..39369c43f 100644
--- a/contrib/epee/src/readline_buffer.cpp
+++ b/contrib/epee/src/readline_buffer.cpp
@@ -114,7 +114,7 @@ int rdln::readline_buffer::sync()
int end = 0, point = 0;
#endif
- if (rl_end || *rl_prompt)
+ if (rl_end || (rl_prompt && *rl_prompt))
{
#if RL_READLINE_VERSION >= 0x0700
rl_clear_visible_line();
@@ -137,7 +137,7 @@ int rdln::readline_buffer::sync()
while ( this->snextc() != EOF );
#if RL_READLINE_VERSION < 0x0700
- if (end || *rl_prompt)
+ if (end || (rl_prompt && *rl_prompt))
{
rl_restore_prompt();
rl_line_buffer = line;