diff options
author | Abdullah Sowayan <sowayan@users.noreply.github.com> | 2007-09-13 15:18:33 +0000 |
---|---|---|
committer | Abdullah Sowayan <sowayan@users.noreply.github.com> | 2007-09-13 15:18:33 +0000 |
commit | 42a6ca44003ec49675001069d5ccc02a157d5ecc (patch) | |
tree | 5fc21382ab1fcee128e4da3c5714c95248488afa | |
parent | ae47388e9014a0e532fdd5a79438e561456b24fb (diff) | |
download | ATCD-42a6ca44003ec49675001069d5ccc02a157d5ecc.tar.gz |
Thu Sep 13 15:17:28 UTC 2007 Abdullah Sowayan <abdullah.sowayan@lmco.com>
-rw-r--r-- | ACE/ChangeLog | 16 | ||||
-rw-r--r-- | ACE/ace/ATM_Stream.cpp | 14 | ||||
-rw-r--r-- | ACE/ace/Lib_Find.cpp | 16 | ||||
-rw-r--r-- | ACE/ace/Metrics_Cache_T.cpp | 23 | ||||
-rw-r--r-- | ACE/ace/Process_Mutex.cpp | 4 | ||||
-rw-r--r-- | ACE/ace/Service_Config.cpp | 4 | ||||
-rw-r--r-- | ACE/ace/Service_Gestalt.cpp | 4 | ||||
-rw-r--r-- | ACE/ace/Service_Manager.cpp | 3 | ||||
-rw-r--r-- | ACE/ace/Throughput_Stats.cpp | 4 | ||||
-rw-r--r-- | ACE/ace/Timeprobe_T.cpp | 6 |
10 files changed, 63 insertions, 31 deletions
diff --git a/ACE/ChangeLog b/ACE/ChangeLog index e27d29108f6..7442fdb69b4 100644 --- a/ACE/ChangeLog +++ b/ACE/ChangeLog @@ -1,3 +1,19 @@ +Thu Sep 13 15:17:28 UTC 2007 Abdullah Sowayan <abdullah.sowayan@lmco.com> + + * ace/ATM_Stream.cpp: + * ace/Lib_Find.cpp: + * ace/Metrics_Cache_T.cpp: + * ace/Process_Mutex.cpp: + * ace/Service_Config.cpp: + * ace/Service_Gestalt.cpp: + * ace/Service_Manager.cpp: + * ace/Throughput_Stats.cpp: + * ace/Timeprobe_T.cpp: + + Fixed ACE_OS fuzz warnings. Use ACE_OS calls instead of raw OS functions + where possible. If fuzz detected a false-positive, then disable + the ACE_OS fuzz check for that section of the code. + Thu Sep 13 08:55:38 UTC 2007 Johnny Willemsen <jwillemsen@remedy.nl> * ace/config-sunos5.5.h: diff --git a/ACE/ace/ATM_Stream.cpp b/ACE/ace/ATM_Stream.cpp index 8cbc909a44d..21035b97f52 100644 --- a/ACE/ace/ATM_Stream.cpp +++ b/ACE/ace/ATM_Stream.cpp @@ -61,21 +61,21 @@ ACE_ATM_Stream::get_peer_name (void) const int nameSize = sizeof (name); if (ACE_OS::getpeername (this->get_handle (), - (struct sockaddr *) &name, - &nameSize) != 0) { + (struct sockaddr *) &name, + &nameSize) != 0) { return 0; } char buffer[256]; for (unsigned int index = 0; index < ATM_ADDR_SIZE - 1; index++) { buffer[ index * 3 ] = '\0'; - sprintf (buffer, "%s%02x.", buffer, name.satm_number.Addr[ index ]); + ACE_OS::sprintf (buffer, "%s%02x.", buffer, name.satm_number.Addr[ index ]); } buffer[ (ATM_ADDR_SIZE - 1) * 3 ] = '\0'; - sprintf (buffer, "%s%02x.", buffer, 0); + ACE_OS::sprintf (buffer, "%s%02x.", buffer, 0); buffer[ ATM_ADDR_SIZE * 3 - 1 ] = '\0'; for (index = 0; index < ACE_OS::strlen (buffer); ++index) - buffer[index] = tolower (buffer[index]); + buffer[index] = ACE_OS::ace_tolower (buffer[index]); ifstream atm_hosts ("C:/WINNT/atmhosts"); assert (atm_hosts.is_open ()); @@ -89,13 +89,13 @@ ACE_ATM_Stream::get_peer_name (void) const atm_hosts.getline (line, 256); // Convert the line to lower case to ease comparison for (index = 0; index < ACE_OS::strlen (line); ++index) - line[index] = tolower (line[index]); + line[index] = ACE_OS::ace_tolower (line[index]); if (ACE_OS::strstr (line, buffer) != 0) { char *strtok_p; // Grab the second token which is the host name ACE_OS::strtok_r (line, " \t", &strtok_p); - host_ptr = strtok (0, " \t", &strtok_p); + host_ptr = ACE_OS::strtok (0, " \t", &strtok_p); ACE_OS::strcpy (host_name, host_ptr); break; } diff --git a/ACE/ace/Lib_Find.cpp b/ACE/ace/Lib_Find.cpp index 771536cdf8f..e96cd9335e9 100644 --- a/ACE/ace/Lib_Find.cpp +++ b/ACE/ace/Lib_Find.cpp @@ -124,7 +124,7 @@ ACE::ldfind (const ACE_TCHAR* filename, { ACE_TRACE ("ACE::ldfind"); #if defined (ACE_OPENVMS) - if (strlen(filename) >= maxpathnamelen) + if (ACE_OS::strlen(filename) >= maxpathnamelen) { errno = ENOMEM; return -1; @@ -133,14 +133,14 @@ ACE::ldfind (const ACE_TCHAR* filename, dsc$descriptor nameDsc; nameDsc.dsc$b_class = DSC$K_CLASS_S; nameDsc.dsc$b_dtype = DSC$K_DTYPE_T; - nameDsc.dsc$w_length = strlen(filename); + nameDsc.dsc$w_length = ACE_OS::strlen(filename); nameDsc.dsc$a_pointer = (char*)filename; char symbol[] = "NULL"; dsc$descriptor symbolDsc; symbolDsc.dsc$b_class = DSC$K_CLASS_S; symbolDsc.dsc$b_dtype = DSC$K_DTYPE_T; - symbolDsc.dsc$w_length = strlen(symbol); + symbolDsc.dsc$w_length = ACE_OS::strlen(symbol); symbolDsc.dsc$a_pointer = symbol; int symbolValue; @@ -159,20 +159,20 @@ ACE::ldfind (const ACE_TCHAR* filename, if (severity == STS$K_SUCCESS || severity == STS$K_WARNING || severity == STS$K_INFO || (severity == STS$K_ERROR && conditionId == (LIB$_KEYNOTFOU & STS$M_COND_ID))) { - strcpy(pathname, filename); + ACE_OS::strcpy(pathname, filename); return 0; } - if (strlen(filename) + strlen(ACE_DLL_PREFIX) >= maxpathnamelen) + if (ACE_OS::strlen(filename) + ACE_OS::strlen(ACE_DLL_PREFIX) >= maxpathnamelen) { errno = ENOMEM; return -1; } - strcpy(pathname, ACE_DLL_PREFIX); - strcat(pathname, filename); - nameDsc.dsc$w_length = strlen(pathname); + ACE_OS::strcpy(pathname, ACE_DLL_PREFIX); + ACE_OS::strcat(pathname, filename); + nameDsc.dsc$w_length = ACE_OS::strlen(pathname); nameDsc.dsc$a_pointer = pathname; try { diff --git a/ACE/ace/Metrics_Cache_T.cpp b/ACE/ace/Metrics_Cache_T.cpp index a3850eb2237..285df4a9753 100644 --- a/ACE/ace/Metrics_Cache_T.cpp +++ b/ACE/ace/Metrics_Cache_T.cpp @@ -47,10 +47,10 @@ ACE_Metrics_Timeprobe<ACE_LOCK, ALLOCATOR>::ACE_Metrics_Timeprobe (u_int id, char * name_tmp = 0; ACE_NEW_MALLOC_ARRAY (name_tmp, - (char *) this->allocator ()->malloc (strlen(name)+1), + (char *) this->allocator ()->malloc (ACE_OS::strlen(name)+1), char, - strlen(name)+1); - ACE_OS::memcpy (name_tmp, name, strlen (name)+1); + ACE_OS::strlen(name)+1); + ACE_OS::memcpy (name_tmp, name, ACE_OS::strlen (name)+1); name_ = name_tmp; this->event_descriptions (event_description_strings, @@ -63,9 +63,8 @@ ACE_Metrics_Timeprobe (ALLOCATOR *alloc, u_int id, const char *name, u_long size) - : - ACE_Timeprobe_Ex<ACE_LOCK, ALLOCATOR> (size), - id_ (id), + : ACE_Timeprobe_Ex<ACE_LOCK, ALLOCATOR> (size), + id_ (id), name_ (0) { if (name == 0) @@ -75,10 +74,10 @@ ACE_Metrics_Timeprobe (ALLOCATOR *alloc, char * name_tmp = 0; ACE_NEW_MALLOC_ARRAY (name_tmp, - (char *) alloc->malloc(strlen(name)+1), + (char *) alloc->malloc(ACE_OS::strlen(name)+1), char, - strlen(name)+1); - ACE_OS::memcpy (name_tmp, name, strlen (name)+1); + ACE_OS::strlen(name)+1); + ACE_OS::memcpy (name_tmp, name, ACE_OS::strlen (name)+1); name_ = name_tmp; this->event_descriptions (event_description_strings, @@ -122,10 +121,10 @@ ACE_Metrics_Timeprobe<ACE_LOCK, ALLOCATOR>::probe_name (char * name) { char * name_tmp = 0; ACE_NEW_MALLOC_ARRAY (name_tmp, - (char *) this->allocator ()->malloc (strlen(name)+1), + (char *) this->allocator ()->malloc (ACE_OS::strlen(name)+1), char, - strlen(name)+1); - ACE_OS::memcpy (name_tmp, name, strlen (name)+1); + ACE_OS::strlen(name)+1); + ACE_OS::memcpy (name_tmp, name, ACE_OS::strlen (name)+1); if (name_) { diff --git a/ACE/ace/Process_Mutex.cpp b/ACE/ace/Process_Mutex.cpp index b6ac8b51e16..9aba33a7894 100644 --- a/ACE/ace/Process_Mutex.cpp +++ b/ACE/ace/Process_Mutex.cpp @@ -48,7 +48,7 @@ ACE_Process_Mutex::ACE_Process_Mutex (const char *name, void *arg, mode_t mode) #else : lock_ (USYNC_PROCESS, name ? - ACE_TEXT_CHAR_TO_TCHAR (name) : unique_name (), + ACE_TEXT_CHAR_TO_TCHAR (name) : this->unique_name (), (ACE_mutexattr_t *) arg, mode) #endif /* _ACE_USE_SV_SEM */ @@ -73,7 +73,7 @@ ACE_Process_Mutex::ACE_Process_Mutex (const wchar_t *name, #else : lock_ (USYNC_PROCESS, name ? - ACE_TEXT_WCHAR_TO_TCHAR (name) : unique_name (), + ACE_TEXT_WCHAR_TO_TCHAR (name) : this->unique_name (), (ACE_mutexattr_t *) arg, mode) #endif /* _ACE_USE_SV_SEM */ diff --git a/ACE/ace/Service_Config.cpp b/ACE/ace/Service_Config.cpp index 1c90474adc2..0cf6e8d91dc 100644 --- a/ACE/ace/Service_Config.cpp +++ b/ACE/ace/Service_Config.cpp @@ -110,19 +110,23 @@ ACE_Service_Config::parse_args_i (int argc, ACE_TCHAR *argv[]) // to the end of the argument vector. We'll pick them up // after processing our options and pass them on to the // base class for further parsing. + //FUZZ: disable check_for_lack_ACE_OS ACE_Get_Opt getopt (argc, argv, ACE_TEXT ("bs:p:"), 1 , // Start at argv[1]. 0, // Do not report errors ACE_Get_Opt::RETURN_IN_ORDER); + //FUZZ: enable check_for_lack_ACE_OS // Keep a list of all unknown arguments, begin with the // executable's name ACE_ARGV superargv; superargv.add (argv[0]); + //FUZZ: disable check_for_lack_ACE_OS for (int c; (c = getopt ()) != -1; ) + //FUZZ: enable check_for_lack_ACE_OS switch (c) { case 'p': diff --git a/ACE/ace/Service_Gestalt.cpp b/ACE/ace/Service_Gestalt.cpp index 7fb4a07b927..19606125dbe 100644 --- a/ACE/ace/Service_Gestalt.cpp +++ b/ACE/ace/Service_Gestalt.cpp @@ -1130,15 +1130,19 @@ int ACE_Service_Gestalt::parse_args_i (int argc, ACE_TCHAR *argv[]) { ACE_TRACE ("ACE_Service_Gestalt::parse_args_i"); + //FUZZ: disable check_for_lack_ACE_OS ACE_Get_Opt getopt (argc, argv, ACE_TEXT ("df:k:nyS:"), 1); // Start at argv[1]. + //FUZZ: enable check_for_lack_ACE_OS if (this->init_svc_conf_file_queue () == -1) return -1; + //FUZZ: disable check_for_lack_ACE_OS for (int c; (argc != 0) && ((c = getopt ()) != -1); ) + //FUZZ: enable check_for_lack_ACE_OS switch (c) { case 'd': diff --git a/ACE/ace/Service_Manager.cpp b/ACE/ace/Service_Manager.cpp index f32e03b4d82..979187be847 100644 --- a/ACE/ace/Service_Manager.cpp +++ b/ACE/ace/Service_Manager.cpp @@ -96,9 +96,12 @@ ACE_Service_Manager::init (int argc, ACE_TCHAR *argv[]) { ACE_TRACE ("ACE_Service_Manager::init"); ACE_INET_Addr local_addr (ACE_Service_Manager::DEFAULT_PORT_); + + //FUZZ: disable check_for_lack_ACE_OS ACE_Get_Opt getopt (argc, argv, ACE_TEXT ("dp:s:"), 0); // Start at argv[0] for (int c; (c = getopt ()) != -1; ) + //FUZZ: enable check_for_lack_ACE_OS switch (c) { case 'd': diff --git a/ACE/ace/Throughput_Stats.cpp b/ACE/ace/Throughput_Stats.cpp index d2d346eafd4..d76f5cb6ebc 100644 --- a/ACE/ace/Throughput_Stats.cpp +++ b/ACE/ace/Throughput_Stats.cpp @@ -45,7 +45,7 @@ ACE_Throughput_Stats::sample (ACE_UINT64 throughput, this->throughput_sum_x2_ = throughput * throughput; this->throughput_sum_xy_ = throughput * this->samples_count_; - printf ("%f %qu\n", throughput / 400000000.0, this->samples_count_); + ACE_OS::printf ("%f %qu\n", throughput / 400000000.0, this->samples_count_); #endif /* 0 */ } else @@ -61,7 +61,7 @@ ACE_Throughput_Stats::sample (ACE_UINT64 throughput, this->throughput_sum_x2_ += throughput * throughput; this->throughput_sum_xy_ += throughput * this->samples_count_; - printf ("%f %qu\n", throughput / 400000000.0, this->samples_count_); + ACE_OS::printf ("%f %qu\n", throughput / 400000000.0, this->samples_count_); #endif /* 0 */ } } diff --git a/ACE/ace/Timeprobe_T.cpp b/ACE/ace/Timeprobe_T.cpp index 39f1bfc804e..dcb1edbb791 100644 --- a/ACE/ace/Timeprobe_T.cpp +++ b/ACE/ace/Timeprobe_T.cpp @@ -27,11 +27,13 @@ ACE_Timeprobe_Ex<ACE_LOCK, ALLOCATOR>::ACE_Timeprobe_Ex (u_long size) allocator_ (0) { ACE_timeprobe_t *temp; + //FUZZ: disable check_for_lack_ACE_OS ACE_NEW_MALLOC_ARRAY (temp, (ACE_timeprobe_t *) this->allocator ()-> malloc (this->max_size_*sizeof(ACE_timeprobe_t)), ACE_timeprobe_t, this->max_size_); + //FUZZ: enable check_for_lack_ACE_OS this->timeprobes_ = temp; } @@ -48,11 +50,13 @@ ACE_Timeprobe_Ex (ALLOCATOR *allocator, allocator_ (allocator) { ACE_timeprobe_t *temp = 0; + //FUZZ: disable check_for_lack_ACE_OS ACE_NEW_MALLOC_ARRAY (temp, (ACE_timeprobe_t *) this->allocator ()-> malloc (this->max_size_*sizeof(ACE_timeprobe_t)), ACE_timeprobe_t, this->max_size_); + //FUZZ: enable check_for_lack_ACE_OS this->timeprobes_ = temp; } @@ -143,12 +147,14 @@ ACE_Timeprobe_Ex<ACE_LOCK, ALLOCATOR>::increase_size (u_long size) if (size > this->max_size_) { ACE_timeprobe_t *temp = 0; + //FUZZ: disable check_for_lack_ACE_OS ACE_NEW_MALLOC_ARRAY (temp, (ACE_timeprobe_t *) this->allocator ()-> malloc (this->max_size_ * sizeof (ACE_timeprobe_t)), ACE_timeprobe_t, size); + //FUZZ: enable check_for_lack_ACE_OS if (this->max_size_ > 0) { |