From 45026d43f6cfbe0f6efa446b47629cb948db5a9d Mon Sep 17 00:00:00 2001 From: Kozlov Dmitry Date: Thu, 15 Nov 2012 14:21:35 +0400 Subject: merge upstream --- accel-pppd/cli/show_sessions.c | 2 +- accel-pppd/cli/std_cmd.c | 2 ++ accel-pppd/cli/tcp.c | 4 +++- accel-pppd/cli/telnet.c | 4 +++- 4 files changed, 9 insertions(+), 3 deletions(-) (limited to 'accel-pppd/cli') diff --git a/accel-pppd/cli/show_sessions.c b/accel-pppd/cli/show_sessions.c index 9e0ad2f..2140dec 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) { diff --git a/accel-pppd/cli/std_cmd.c b/accel-pppd/cli/std_cmd.c index d2666d8..7a890d1 100644 --- a/accel-pppd/cli/std_cmd.c +++ b/accel-pppd/cli/std_cmd.c @@ -130,6 +130,8 @@ static int terminate_exec1(char * const *f, int f_cnt, void *cli) pthread_rwlock_rdlock(&ses_lock); list_for_each_entry(ses, &ses_list, entry) { + if (!ses->username) + continue; if (pcre_exec(re, NULL, ses->username, strlen(ses->username), 0, 0, NULL, 0) < 0) continue; if (hard) diff --git a/accel-pppd/cli/tcp.c b/accel-pppd/cli/tcp.c index 9ea914c..b2ed910 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 e9e886d..5a42a99 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