Permalink
Browse files

readline: don't dereference possible NULL pointer

  • Loading branch information...
jtgrassie committed Jan 12, 2019
1 parent 094b0c4 commit b3b3ac232890e37206215b93274e40c8855a8486
Showing with 2 additions and 2 deletions.
  1. +2 −2 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;

0 comments on commit b3b3ac2

Please sign in to comment.