summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2016-09-12 17:55:32 +0200
committerAndreas Baumann <mail@andreasbaumann.cc>2016-09-12 17:55:32 +0200
commit4719aa7b298ddd3f72c615284ccf9d29adf9fce3 (patch)
tree63fa723cf9333ac4e795a5767ee59ac850ba85a0
parent6edb2c620fafa15acf25275c04355e34abeeef72 (diff)
downloadcssh-4719aa7b298ddd3f72c615284ccf9d29adf9fce3.tar.gz
cssh-4719aa7b298ddd3f72c615284ccf9d29adf9fce3.tar.bz2
fixed a realloc size mismatch (thanks to OpenBSD's implementation of realloc to find it)
-rw-r--r--src/cssh.c2
1 files changed, 1 insertions, 1 deletions
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 ) );