[asterisk-bugs] [JIRA] (ASTERISK-27559) [patch] editline: Avoid comparison between pointer and zero character constant.

Alexander Traud (JIRA) noreply at issues.asterisk.org
Sat Jan 6 06:41:39 CST 2018


Alexander Traud created ASTERISK-27559:
------------------------------------------

             Summary: [patch] editline: Avoid comparison between pointer and zero character constant.
                 Key: ASTERISK-27559
                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-27559
             Project: Asterisk
          Issue Type: Bug
      Security Level: None
          Components: General
    Affects Versions: 15.1.5, 13.18.5
            Reporter: Alexander Traud
            Severity: Minor


The compiler GCC (7.2) reports:{code}In file included from editline.c:18:0:
term.c: In function 'term_alloc':
term.c:431:28: warning: comparison between pointer and zero character constant [-Wpointer-compare]
   if (*tmp != NULL && *tmp != '\0' && *tmp != *str) {
                            ^~
term.c:431:23: note: did you mean to dereference the pointer?{code}This is an external library, which is still maintained: http://thrysoee.dk/editline/

That upstream project is active, the last change happened just four days ago (officially it is called libedit 2.11). The copy within Asterisk is from 2002, libedit 2.6.

The short-term workaround is to use the precompiled libedit of your Unix distribution, for example in Debian/Ubuntu: {{sudo apt install libedit-dev}}. As mid-term solution, I attached/backported the change which resolves the compiler issue above ([original source|http://cvsweb.netbsd.org/bsdweb.cgi/src/lib/libedit/terminal.c.diff?r1=1.22&r2=1.24]).

Although that library has seen only 49 commits over the last 15 years in Asterisk, as long-term approach, that external library should be
A) updated to the latest upstream version. Or
B) removed and relied solely on precompiled Unix packages, see ASTERISK-18725.



--
This message was sent by Atlassian JIRA
(v6.2#6252)



More information about the asterisk-bugs mailing list