octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #55391] readline function 'operate-and-get-nex


From: Rik
Subject: [Octave-bug-tracker] [bug #55391] readline function 'operate-and-get-next' (Ctrl+o) crashes interpreter
Date: Fri, 4 Jan 2019 20:08:41 -0500 (EST)
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko

Follow-up Comment #8, bug #55391 (project octave):

As a separate item, the issues identified by the static analyzer about a
potential null pointer being passed to strcpy are all due to this macro
)


#define OCTAVE_RL_SAVE_STRING(ss, s) \
  static char *ss = 0; \
 \
  if (ss) \
    { \
      free (ss); \
      ss = 0; \
    } \
 \
  ss = malloc (strlen (s) + 1); \
 \
  strcpy (ss, s)


Seems like we should check that the malloc succeeds with "if (ss)", but then
what should we do?  Should we simply return from the function that where the
macro was embedded?  Should we call current_liboctave_error_handler?


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?55391>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]