From 4719aa7b298ddd3f72c615284ccf9d29adf9fce3 Mon Sep 17 00:00:00 2001 From: Andreas Baumann Date: Mon, 12 Sep 2016 17:55:32 +0200 Subject: fixed a realloc size mismatch (thanks to OpenBSD's implementation of realloc to find it) --- src/cssh.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cssh.c b/src/cssh.c index 4ecb281..486ed16 100644 --- a/src/cssh.c +++ b/src/cssh.c @@ -416,7 +416,7 @@ static int read_hosts_file( const char *hosts_file, unsigned short default_port, } (*host)[*nof_hosts] = strdup( buf ); (*nof_hosts)++; - if( *nof_hosts > size_hosts ) { + if( *nof_hosts >= size_hosts ) { size_hosts *= 2; *host = (char **)realloc( *host, size_hosts * sizeof( char *) ); *port = (unsigned short *)realloc( *port, size_hosts * sizeof( unsigned short ) ); -- cgit v1.2.3-54-g00ecf