fix bug #24088 - bad memory allocation when reading super users file
authorAleš Křenek <ljocha@ics.muni.cz>
Mon, 26 Feb 2007 11:53:08 +0000 (11:53 +0000)
committerAleš Křenek <ljocha@ics.muni.cz>
Mon, 26 Feb 2007 11:53:08 +0000 (11:53 +0000)
org.glite.lb.server/src/bkserverd.c

index 0eab69f..45e8be3 100644 (file)
@@ -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;
        }