From: Aleš Křenek Date: Mon, 26 Feb 2007 11:53:08 +0000 (+0000) Subject: fix bug #24088 - bad memory allocation when reading super users file X-Git-Tag: glite-lb-server_R_1_3_12_1~1 X-Git-Url: http://scientific.zcu.cz/git/?a=commitdiff_plain;h=ff6ab33d1a912bc0abb30c9e9f6e5232c61c1102;p=jra1mw.git fix bug #24088 - bad memory allocation when reading super users file --- diff --git a/org.glite.lb.server/src/bkserverd.c b/org.glite.lb.server/src/bkserverd.c index 0eab69f..45e8be3 100644 --- a/org.glite.lb.server/src/bkserverd.c +++ b/org.glite.lb.server/src/bkserverd.c @@ -1387,7 +1387,7 @@ static int read_roots(const char *file) nl = strchr(buf,'\n'); if (nl) *nl = 0; - super_users = realloc(super_users, (cnt+1) * sizeof super_users[0]); + super_users = realloc(super_users, (cnt+2) * sizeof super_users[0]); super_users[cnt] = strdup(buf); super_users[++cnt] = NULL; }