[Bug 252] Patch for use of /etc/default/login

bugzilla-daemon at mindrot.org bugzilla-daemon at mindrot.org
Mon Sep 15 09:29:08 EST 2003


http://bugzilla.mindrot.org/show_bug.cgi?id=252





------- Additional Comments From djm at mindrot.org  2003-09-15 09:29 -------
(From update of attachment 378)

>+	if (*envp == NULL && *envsizep == 0) {
>+		*envp = xmalloc(sizeof(char *));
>+		*envp[0] = NULL;
>+		*envsizep = 1;
>+	}
>+

An expanatory comment here would be good.

>+char *
>+child_get_env(char **env, const char *name)
>+{
>+	int i;
>+	size_t len;
>+
>+	len = strlen(name);
>+	for (i=0; env[i] != NULL; i++)
>+		if (env[i][len] == '=' && strncmp(name, env[i], len) == 0)
>+			return(env[i] + len + 1);

I think the order of this test should be reversed. env[i][len] may be past the
end of the environment string if name is long (e.g. name = "blahblahblah",
env[i] = "a=b").

Otherwise OK




------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.




More information about the openssh-bugs mailing list