summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/libc/stdlib/getenv.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/libc/stdlib/getenv.c b/lib/libc/stdlib/getenv.c
index 47963d53dd62..079b024dcfab 100644
--- a/lib/libc/stdlib/getenv.c
+++ b/lib/libc/stdlib/getenv.c
@@ -505,7 +505,7 @@ __setenv(const char *name, size_t nameLen, const char *value, int overwrite)
envVars[envNdx].valueSize = valueLen;
/* Save name of name/value pair. */
- env = stpcpy(envVars[envNdx].name, name);
+ env = stpncpy(envVars[envNdx].name, name, nameLen);
if ((envVars[envNdx].name)[nameLen] != '=')
env = stpcpy(env, "=");
}