From f9d7a5755e9df40409864667811a4497bbd75b63 Mon Sep 17 00:00:00 2001 From: Kozlov Dmitry Date: Fri, 2 Nov 2012 16:46:52 +0400 Subject: cli: fix double buffer free --- accel-pppd/cli/tcp.c | 4 +++- accel-pppd/cli/telnet.c | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/accel-pppd/cli/tcp.c b/accel-pppd/cli/tcp.c index 9ea914c9..b2ed9105 100644 --- a/accel-pppd/cli/tcp.c +++ b/accel-pppd/cli/tcp.c @@ -208,8 +208,10 @@ static int cln_write(struct triton_md_handler_t *h) _free(cln->xmit_buf); cln->xmit_pos = 0; - if (list_empty(&cln->xmit_queue)) + if (list_empty(&cln->xmit_queue)) { + cln->xmit_buf = NULL; break; + } cln->xmit_buf = list_entry(cln->xmit_queue.next, typeof(*cln->xmit_buf), entry); list_del(&cln->xmit_buf->entry); diff --git a/accel-pppd/cli/telnet.c b/accel-pppd/cli/telnet.c index 314ac9e9..7409767c 100644 --- a/accel-pppd/cli/telnet.c +++ b/accel-pppd/cli/telnet.c @@ -518,8 +518,10 @@ static int cln_write(struct triton_md_handler_t *h) _free(cln->xmit_buf); cln->xmit_pos = 0; - if (list_empty(&cln->xmit_queue)) + if (list_empty(&cln->xmit_queue)) { + cln->xmit_buf = NULL; break; + } cln->xmit_buf = list_entry(cln->xmit_queue.next, typeof(*cln->xmit_buf), entry); list_del(&cln->xmit_buf->entry); -- cgit v1.2.3 From 5fd5776d2175e92179461fd69f897146c151c765 Mon Sep 17 00:00:00 2001 From: Kozlov Dmitry Date: Sat, 3 Nov 2012 02:11:07 +0400 Subject: cli: fix 'show sessions match' without enough arguments --- accel-pppd/cli/show_sessions.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/accel-pppd/cli/show_sessions.c b/accel-pppd/cli/show_sessions.c index c0fec580..983e6205 100644 --- a/accel-pppd/cli/show_sessions.c +++ b/accel-pppd/cli/show_sessions.c @@ -148,7 +148,7 @@ static int show_ses_exec(const char *cmd, char * const *f, int f_cnt, void *cli) return CLI_CMD_OK; } } else if (!strcmp(f[i], "match")) { - if (i == f_cnt - 1) + if (i >= f_cnt - 2) return CLI_CMD_SYNTAX; match_key = find_column(f[++i]); if (!match_key) { -- cgit v1.2.3 From c8e89029002ebf05932d0247e8a03215dd1c66ef Mon Sep 17 00:00:00 2001 From: Kozlov Dmitry Date: Sat, 3 Nov 2012 02:16:02 +0400 Subject: pppd_compat: set rpath to locate depending libraries --- accel-pppd/extra/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/accel-pppd/extra/CMakeLists.txt b/accel-pppd/extra/CMakeLists.txt index e7b9f072..cbaef49c 100644 --- a/accel-pppd/extra/CMakeLists.txt +++ b/accel-pppd/extra/CMakeLists.txt @@ -1,5 +1,6 @@ ADD_LIBRARY(pppd_compat SHARED pppd_compat.c) TARGET_LINK_LIBRARIES(pppd_compat sigchld) +set_property(TARGET pppd_compat PROPERTY INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/lib/accel-ppp) ADD_LIBRARY(ippool SHARED ippool.c) ADD_LIBRARY(ipv6pool SHARED ipv6pool.c) ADD_LIBRARY(sigchld SHARED sigchld.c) -- cgit v1.2.3