diff options
author | Adam Mitz <mitza@objectcomputing.com> | 2022-09-22 17:58:28 -0500 |
---|---|---|
committer | Adam Mitz <mitza@objectcomputing.com> | 2022-10-03 13:20:45 -0500 |
commit | a33cf7cd35bb9735823fa1276617c38edbd8b385 (patch) | |
tree | 239f31538c261643345477541dc2b0260b0ac3d4 /TAO | |
parent | 61a1fbae63918fc59b7d9f2e5b6a902975877078 (diff) | |
download | ATCD-a33cf7cd35bb9735823fa1276617c38edbd8b385.tar.gz |
Merge pull request #1907 from lukem/format-security
Fix -Wformat-security issues
(cherry picked from commit 0b7e12778ae92315cbd51c901cb8402d6bd646a7)
# Conflicts:
# ACE/websvcs/lib/URL_Addr.cpp
Diffstat (limited to 'TAO')
-rw-r--r-- | TAO/orbsvcs/FTRT_Event_Service/Factory_Service/EventChannelFactory_i.cpp | 8 | ||||
-rw-r--r-- | TAO/orbsvcs/ImplRepo_Service/ImR_Activator_i.cpp | 6 | ||||
-rw-r--r-- | TAO/orbsvcs/tests/HTIOP/test_config.h | 10 |
3 files changed, 12 insertions, 12 deletions
diff --git a/TAO/orbsvcs/FTRT_Event_Service/Factory_Service/EventChannelFactory_i.cpp b/TAO/orbsvcs/FTRT_Event_Service/Factory_Service/EventChannelFactory_i.cpp index aeb2d6bfb1c..ff81d3bc106 100644 --- a/TAO/orbsvcs/FTRT_Event_Service/Factory_Service/EventChannelFactory_i.cpp +++ b/TAO/orbsvcs/FTRT_Event_Service/Factory_Service/EventChannelFactory_i.cpp @@ -103,7 +103,8 @@ CORBA::Object_ptr EventChannelFactory_i::create_process ( const int ENV_BUF_LEN = 512; ACE_TCHAR buf[ENV_BUF_LEN]; server_addr.addr_to_string(buf,ENV_BUF_LEN,0); - options.setenv(ACE_TEXT("EventChannelFactoryAddr"), buf); + options.setenv(ACE_TEXT("EventChannelFactoryAddr"), + ACE_TEXT("%") ACE_TEXT_PRIs, buf); // extract the object ID from the criteria for (CORBA::ULong i = 0; i < the_criteria.length(); ++i) @@ -114,7 +115,8 @@ CORBA::Object_ptr EventChannelFactory_i::create_process ( const char* id_str = name[0].id.in(); the_criteria[i].val >>= val; if (id_str[0] != '-') // environment variable - options.setenv(ACE_TEXT_CHAR_TO_TCHAR(id_str), ACE_TEXT("%s"), val); + options.setenv(ACE_TEXT_CHAR_TO_TCHAR(id_str), + ACE_TEXT("%") ACE_TEXT_PRIs, val); else {// command line option ACE_OS::sprintf(buf, ACE_TEXT(" %s %s"), id_str, val); str += buf; @@ -124,7 +126,7 @@ CORBA::Object_ptr EventChannelFactory_i::create_process ( ORBSVCS_DEBUG((LM_DEBUG, "Command Line : %s\n", str.c_str())); - options.command_line(str.c_str()); + options.command_line(ACE_TEXT("%") ACE_TEXT_PRIs, str.c_str()); // Try to create a new process running date. ACE_Process new_process; diff --git a/TAO/orbsvcs/ImplRepo_Service/ImR_Activator_i.cpp b/TAO/orbsvcs/ImplRepo_Service/ImR_Activator_i.cpp index ab2e06d5c0f..8551aad3601 100644 --- a/TAO/orbsvcs/ImplRepo_Service/ImR_Activator_i.cpp +++ b/TAO/orbsvcs/ImplRepo_Service/ImR_Activator_i.cpp @@ -537,7 +537,7 @@ ImR_Activator_i::start_server(const char* name, 1, cmdline_buf_len + 1, this->env_buf_len_, this->max_env_vars_); - proc_opts.command_line (ACE_TEXT_CHAR_TO_TCHAR(cmdline)); + proc_opts.command_line (ACE_TEXT("%") ACE_TEXT_PRIs, ACE_TEXT_CHAR_TO_TCHAR(cmdline)); proc_opts.working_directory (dir); // Win32 does not support the CLOSE_ON_EXEC semantics for sockets // the way unix does, so in order to avoid having the child process @@ -564,13 +564,13 @@ ImR_Activator_i::start_server(const char* name, { CORBA::String_var ior = orb_->object_to_string (locator_.in ()); proc_opts.setenv (ACE_TEXT ("ImplRepoServiceIOR"), - ACE_TEXT_CHAR_TO_TCHAR (ior.in ())); + ACE_TEXT("%") ACE_TEXT_PRIs, ACE_TEXT_CHAR_TO_TCHAR (ior.in ())); } for (CORBA::ULong i = 0; i < env.length (); ++i) { proc_opts.setenv (ACE_TEXT_CHAR_TO_TCHAR (env[i].name.in ()), - ACE_TEXT_CHAR_TO_TCHAR (env[i].value.in ())); + ACE_TEXT("%") ACE_TEXT_PRIs, ACE_TEXT_CHAR_TO_TCHAR (env[i].value.in ())); } pid = this->process_mgr_.spawn (proc_opts, this); diff --git a/TAO/orbsvcs/tests/HTIOP/test_config.h b/TAO/orbsvcs/tests/HTIOP/test_config.h index d44559b8963..4bb8f2982ae 100644 --- a/TAO/orbsvcs/tests/HTIOP/test_config.h +++ b/TAO/orbsvcs/tests/HTIOP/test_config.h @@ -126,14 +126,12 @@ size_t const ACE_MAX_THREADS = 4; } #else /* ! VXWORKS */ -# if !defined (ACE_WIN32) && defined (ACE_USES_WCHAR) -# define ACE_INIT_LOG_FMT ACE_TEXT ("%ls%ls%ls") -# else -# define ACE_INIT_LOG_FMT ACE_TEXT ("%s%s%s") -# endif /* !ACE_WIN32 && ACE_USES_WCHAR */ #define ACE_INIT_LOG(NAME) \ ACE_TCHAR temp[MAXPATHLEN]; \ - ACE_OS::sprintf (temp, ACE_INIT_LOG_FMT, \ + ACE_OS::sprintf (temp, \ + ACE_TEXT ("%") ACE_TEXT_PRIs \ + ACE_TEXT ("%") ACE_TEXT_PRIs \ + ACE_TEXT ("%") ACE_TEXT_PRIs, \ ACE_LOG_DIRECTORY, \ ACE::basename (NAME, ACE_DIRECTORY_SEPARATOR_CHAR), \ ACE_LOG_FILE_EXT_NAME); \ |