version 1.277, 2015/01/16 06:40:12 |
version 1.278, 2015/04/24 01:36:00 |
|
|
if (envsize >= 1000) |
if (envsize >= 1000) |
fatal("child_set_env: too many env vars"); |
fatal("child_set_env: too many env vars"); |
envsize += 50; |
envsize += 50; |
env = (*envp) = xrealloc(env, envsize, sizeof(char *)); |
env = (*envp) = xreallocarray(env, envsize, sizeof(char *)); |
*envsizep = envsize; |
*envsizep = envsize; |
} |
} |
/* Need to set the NULL pointer at end of array beyond the new slot. */ |
/* Need to set the NULL pointer at end of array beyond the new slot. */ |
|
|
return NULL; |
return NULL; |
debug2("%s: allocate (allocated %d max %d)", |
debug2("%s: allocate (allocated %d max %d)", |
__func__, sessions_nalloc, options.max_sessions); |
__func__, sessions_nalloc, options.max_sessions); |
tmp = xrealloc(sessions, sessions_nalloc + 1, |
tmp = xreallocarray(sessions, sessions_nalloc + 1, |
sizeof(*sessions)); |
sizeof(*sessions)); |
if (tmp == NULL) { |
if (tmp == NULL) { |
error("%s: cannot allocate %d sessions", |
error("%s: cannot allocate %d sessions", |
|
|
for (i = 0; i < options.num_accept_env; i++) { |
for (i = 0; i < options.num_accept_env; i++) { |
if (match_pattern(name, options.accept_env[i])) { |
if (match_pattern(name, options.accept_env[i])) { |
debug2("Setting env %d: %s=%s", s->num_env, name, val); |
debug2("Setting env %d: %s=%s", s->num_env, name, val); |
s->env = xrealloc(s->env, s->num_env + 1, |
s->env = xreallocarray(s->env, s->num_env + 1, |
sizeof(*s->env)); |
sizeof(*s->env)); |
s->env[s->num_env].name = name; |
s->env[s->num_env].name = name; |
s->env[s->num_env].val = val; |
s->env[s->num_env].val = val; |