diff options
author | Markus Friedl <markus@cvs.openbsd.org> | 2003-10-11 11:36:24 +0000 |
---|---|---|
committer | Markus Friedl <markus@cvs.openbsd.org> | 2003-10-11 11:36:24 +0000 |
commit | da65f4cd325900fbffa3144929d070b0b15d7684 (patch) | |
tree | 407a4674be0b91602297db22bbf9d3655372e5d8 /usr.bin | |
parent | ee0558908eceb869d00454a0c88c3eff9c1e7cf6 (diff) |
return NULL for missing banner; ok djm@
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/ssh/monitor_wrap.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/usr.bin/ssh/monitor_wrap.c b/usr.bin/ssh/monitor_wrap.c index e9598bbce8c..06056da56d9 100644 --- a/usr.bin/ssh/monitor_wrap.c +++ b/usr.bin/ssh/monitor_wrap.c @@ -25,7 +25,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: monitor_wrap.c,v 1.32 2003/09/23 20:17:11 markus Exp $"); +RCSID("$OpenBSD: monitor_wrap.c,v 1.33 2003/10/11 11:36:23 markus Exp $"); #include <openssl/bn.h> #include <openssl/dh.h> @@ -220,7 +220,8 @@ mm_getpwnamallow(const char *login) return (pw); } -char *mm_auth2_read_banner(void) +char * +mm_auth2_read_banner(void) { Buffer m; char *banner; @@ -231,10 +232,16 @@ char *mm_auth2_read_banner(void) mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_AUTH2_READ_BANNER, &m); buffer_clear(&m); - mm_request_receive_expect(pmonitor->m_recvfd, MONITOR_ANS_AUTH2_READ_BANNER, &m); + mm_request_receive_expect(pmonitor->m_recvfd, + MONITOR_ANS_AUTH2_READ_BANNER, &m); banner = buffer_get_string(&m, NULL); buffer_free(&m); + /* treat empty banner as missing banner */ + if (strlen(banner) == 0) { + xfree(banner); + banner = NULL; + } return (banner); } |