Projects
Eulaceura:Factory
llvm-15
_service:obs_scm:0002-Prevent-environment-varia...
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File _service:obs_scm:0002-Prevent-environment-variables-from-exceeding-NAME_MA.patch of Package llvm-15
From 4673c2eaba443678c4dc6ae74ea16a489b415fed Mon Sep 17 00:00:00 2001 From: liyunfei <liyunfei33@huawei.com> Date: Tue, 19 Sep 2023 09:31:43 +0800 Subject: [PATCH] Prevent environment variables from exceeding NAME_MAX --- llvm/lib/Support/Unix/Path.inc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/llvm/lib/Support/Unix/Path.inc b/llvm/lib/Support/Unix/Path.inc index 2ae7c6dc..f13f3165 100644 --- a/llvm/lib/Support/Unix/Path.inc +++ b/llvm/lib/Support/Unix/Path.inc @@ -1427,8 +1427,12 @@ static const char *getEnvTempDir() { // variable. const char *EnvironmentVariables[] = {"TMPDIR", "TMP", "TEMP", "TEMPDIR"}; for (const char *Env : EnvironmentVariables) { - if (const char *Dir = std::getenv(Env)) + if (const char *Dir = std::getenv(Env)) { + if(std::strlen(Dir) > NAME_MAX) { + continue; + } return Dir; + } } return nullptr; -- 2.28.0.windows.1
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2