summaryrefslogtreecommitdiff
path: root/ACE
diff options
context:
space:
mode:
authorAbdullah Sowayan <sowayan@users.noreply.github.com>2007-06-30 04:51:04 +0000
committerAbdullah Sowayan <sowayan@users.noreply.github.com>2007-06-30 04:51:04 +0000
commit1b2308d125261e5851e90d8ef202c4ac83f52c64 (patch)
tree441fce067573429f2251569eedac9eee842f99e8 /ACE
parent677d654ca6d7f298e5e36e4a7dd7c926c6df31f2 (diff)
downloadATCD-1b2308d125261e5851e90d8ef202c4ac83f52c64.tar.gz
Sat Jun 30 04:48:34 UTC 2007 Abdullah Sowayan <abdullah.sowayan@lmco.com>
Diffstat (limited to 'ACE')
-rw-r--r--ACE/ASNMP/asnmp/address.cpp14
-rw-r--r--ACE/ASNMP/asnmp/ctr64.cpp6
-rw-r--r--ACE/ASNMP/asnmp/integer.cpp6
-rw-r--r--ACE/ASNMP/asnmp/octet.cpp12
-rw-r--r--ACE/ASNMP/asnmp/oid.cpp4
-rw-r--r--ACE/ASNMP/asnmp/pdu.cpp6
-rw-r--r--ACE/ASNMP/asnmp/target.cpp12
-rw-r--r--ACE/ASNMP/asnmp/timetick.cpp9
-rw-r--r--ACE/ASNMP/asnmp/transaction.cpp6
-rw-r--r--ACE/ASNMP/asnmp/wpdu.cpp19
-rw-r--r--ACE/ASNMP/examples/get/get.cpp4
-rw-r--r--ACE/ASNMP/examples/get/get_async.cpp4
-rw-r--r--ACE/ASNMP/examples/next/next.cpp4
-rw-r--r--ACE/ASNMP/examples/set/set.cpp4
-rw-r--r--ACE/ASNMP/examples/trap/trap.cpp4
-rw-r--r--ACE/ASNMP/examples/walk/walk.cpp4
-rw-r--r--ACE/ASNMP/tests/Address_Test.cpp3
-rw-r--r--ACE/ChangeLog24
18 files changed, 100 insertions, 45 deletions
diff --git a/ACE/ASNMP/asnmp/address.cpp b/ACE/ASNMP/asnmp/address.cpp
index 8231868bd89..32f43b4ad4e 100644
--- a/ACE/ASNMP/asnmp/address.cpp
+++ b/ACE/ASNMP/asnmp/address.cpp
@@ -42,7 +42,7 @@
#include "ace/OS_NS_netdb.h"
#include "ace/OS_NS_stdlib.h"
#include "ace/OS_NS_stdio.h"
-#include "ace/os_include/os_ctype.h"
+#include "ace/OS_NS_ctype.h"
#include "ace/OS_Memory.h"
ACE_RCSID(asnmp, address, "$Id$")
@@ -470,7 +470,7 @@ int IpAddress::parse_dotted_ipstring( const char *inaddr)
if (( ip_token[z] < '0') || ( ip_token[z] > '9'))
return 0;
- value = ( unsigned int) strtod(ip_token,0);
+ value = ( unsigned int) ACE_OS::strtod(ip_token,0);
if (( value > 0)&& ( value <=255))
address_buffer[token_count] = (unsigned char) value;
else
@@ -1343,7 +1343,7 @@ int IpxAddress::parse_address( const char *inaddr)
// convert the string to all lower case
// this allows hex values to be in upper or lower
for (z=0;z< tmplen;z++)
- temp[z] = tolower(temp[z]);
+ temp[z] = ACE_OS::ace_tolower(temp[z]);
// check for separated nodeid
// if found remove it
@@ -1911,7 +1911,7 @@ int MacAddress::parse_address( const char *inaddr)
// convert to lower
for(z=0;z<ACE_OS::strlen(temp);z++)
- temp[z] = tolower( temp[z]);
+ temp[z] = ACE_OS::ace_tolower( temp[z]);
// check out the MAC address
@@ -1959,9 +1959,9 @@ const char * MacAddress::to_string()
void MacAddress::format_output()
{
if ( valid_flag)
- sprintf(output_buffer,"%02x:%02x:%02x:%02x:%02x:%02x",address_buffer[0],
- address_buffer[1],address_buffer[2],address_buffer[3],
- address_buffer[4],address_buffer[5]);
+ ACE_OS::sprintf(output_buffer,"%02x:%02x:%02x:%02x:%02x:%02x",address_buffer[0],
+ address_buffer[1],address_buffer[2],address_buffer[3],
+ address_buffer[4],address_buffer[5]);
else
output_buffer[0] = 0;
}
diff --git a/ACE/ASNMP/asnmp/ctr64.cpp b/ACE/ASNMP/asnmp/ctr64.cpp
index df3468a1475..60cc9abfbbb 100644
--- a/ACE/ASNMP/asnmp/ctr64.cpp
+++ b/ACE/ASNMP/asnmp/ctr64.cpp
@@ -205,9 +205,9 @@ int Counter64::valid() const
const char * Counter64::to_string()
{
if ( high() != 0 )
- sprintf(output_buffer, "0x%X%08X",
- (unsigned int)high(), (unsigned int)low());
+ ACE_OS::sprintf(output_buffer, "0x%X%08X",
+ (unsigned int)high(), (unsigned int)low());
else
- sprintf(output_buffer, "%d", (int) low());
+ ACE_OS::sprintf(output_buffer, "%d", (int) low());
return output_buffer;
}
diff --git a/ACE/ASNMP/asnmp/integer.cpp b/ACE/ASNMP/asnmp/integer.cpp
index d732e0f3ff9..8b73ce33dc6 100644
--- a/ACE/ASNMP/asnmp/integer.cpp
+++ b/ACE/ASNMP/asnmp/integer.cpp
@@ -125,8 +125,8 @@ SnmpSyntax* SnmpUInt32::clone() const
// ASCII format return
const char * SnmpUInt32::to_string()
{
- sprintf(output_buffer, "%d", (int) (this->smival.value.uNumber));
- return output_buffer;
+ ACE_OS::sprintf(output_buffer, "%d", (int) (this->smival.value.uNumber));
+ return output_buffer;
}
@@ -225,6 +225,6 @@ SnmpSyntax* SnmpInt32::clone() const
const char *SnmpInt32::to_string()
{
- sprintf(output_buffer, "%d", (int) (long) this->smival.value.sNumber);
+ ACE_OS::sprintf(output_buffer, "%d", (int) (long) this->smival.value.sNumber);
return output_buffer;
}
diff --git a/ACE/ASNMP/asnmp/octet.cpp b/ACE/ASNMP/asnmp/octet.cpp
index 885197919c4..315053cd590 100644
--- a/ACE/ASNMP/asnmp/octet.cpp
+++ b/ACE/ASNMP/asnmp/octet.cpp
@@ -546,20 +546,20 @@ const char *OctetStr::to_string_hex()
while (local_len > 0) {
cnt = 16; /* print 16 bytes per line */
buf_ptr = char_buf;
- sprintf(line_ptr, " ");
+ ACE_OS::sprintf(line_ptr, " ");
line_ptr += 2; /* indent */
/*-----------------------*/
/* process a single line */
/*-----------------------*/
while (cnt-- > 0 && local_len-- > 0) {
- sprintf(line_ptr, "%2.2X ", *bytes);
+ ACE_OS::sprintf(line_ptr, "%2.2X ", *bytes);
line_ptr +=3; /* the display of a byte always 3 chars long */
- if (isprint(*bytes))
- sprintf(buf_ptr, "%c", *bytes);
+ if (ACE_OS::ace_isprint(*bytes))
+ ACE_OS::sprintf(buf_ptr, "%c", *bytes);
else
- sprintf(buf_ptr, ".");
+ ACE_OS::sprintf(buf_ptr, ".");
bytes++;
buf_ptr++;
}
@@ -570,7 +570,7 @@ const char *OctetStr::to_string_hex()
/* incomplete lines of hex */
/*----------------------------------------------------------*/
while (cnt-- > 0) {
- sprintf(line_ptr," ");
+ ACE_OS::sprintf(line_ptr," ");
line_ptr += 3;
}
diff --git a/ACE/ASNMP/asnmp/oid.cpp b/ACE/ASNMP/asnmp/oid.cpp
index b5999a1fcbd..3e98c2fd44a 100644
--- a/ACE/ASNMP/asnmp/oid.cpp
+++ b/ACE/ASNMP/asnmp/oid.cpp
@@ -39,7 +39,7 @@
#include "ace/OS_NS_string.h"
#include "ace/OS_NS_stdio.h"
#include "ace/OS_Memory.h"
-#include "ace/os_include/os_ctype.h"
+#include "ace/OS_NS_ctype.h"
ACE_RCSID(asnmp, oid, "$Id$")
@@ -574,7 +574,7 @@ int Oid::StrToOid( const char *string, SmiLPOID dstOid, size_t& how_many)
string++;
// grab a digit token and convert it to a long int
- while (isdigit(*string))
+ while (ACE_OS::ace_isdigit(*string))
number=number*10 + *(string++)-'0';
// check for invalid chars
diff --git a/ACE/ASNMP/asnmp/pdu.cpp b/ACE/ASNMP/asnmp/pdu.cpp
index fe7b175b7c2..1e86fe17d90 100644
--- a/ACE/ASNMP/asnmp/pdu.cpp
+++ b/ACE/ASNMP/asnmp/pdu.cpp
@@ -170,9 +170,9 @@ const char * Pdu::to_string()
ACE_NEW_RETURN(output_, char[size], "");
// print pdu header info
- sprintf(output_, "pdu: valid: %d type:%d, req:%d, cnt: %d, err stat: %d \
- err idx: %d\n", validity_, pdu_type_, (int) request_id_,
- vb_count_, error_status_, error_index_ );
+ ACE_OS::sprintf(output_, "pdu: valid: %d type:%d, req:%d, cnt: %d, err stat: %d \
+ err idx: %d\n", validity_, pdu_type_, (int) request_id_,
+ vb_count_, error_status_, error_index_ );
// now append vb pairs in this object
for ( z = 0; z < vb_count_; z++) {
diff --git a/ACE/ASNMP/asnmp/target.cpp b/ACE/ASNMP/asnmp/target.cpp
index 7c93a9275f9..dd99fa19560 100644
--- a/ACE/ASNMP/asnmp/target.cpp
+++ b/ACE/ASNMP/asnmp/target.cpp
@@ -32,6 +32,7 @@
=====================================================================*/
#include "asnmp/target.h"
+#include "ace/OS_NS_stdio.h"
ACE_RCSID(asnmp, target, "$Id$")
@@ -289,11 +290,12 @@ UdpTarget& UdpTarget::operator=( const UdpTarget& lhs)
const char *UdpTarget::to_string()
{
- sprintf(output_buffer_,"UdpTarget: [ valid: %d addr: %s rd: %s wr: %s \
-ver: %d, timeout: %d, retries: %d max_pdu_size: %d]",
- valid(), udp_address_.to_string(), read_community_.to_string(),
- write_community_.to_string(), version_, (int) timeout_,
- retries_, max_pdu_size_);
+ ACE_OS::sprintf(output_buffer_,"UdpTarget: [ valid: %d addr: %s rd: %s wr: %s \
+ ver: %d, timeout: %d, retries: %d max_pdu_size: %d]",
+ valid(), udp_address_.to_string(), read_community_.to_string(),
+ write_community_.to_string(), version_, (int) timeout_,
+ retries_, max_pdu_size_);
+
return output_buffer_;
}
diff --git a/ACE/ASNMP/asnmp/timetick.cpp b/ACE/ASNMP/asnmp/timetick.cpp
index e6b2d0d2231..f777b43ad64 100644
--- a/ACE/ASNMP/asnmp/timetick.cpp
+++ b/ACE/ASNMP/asnmp/timetick.cpp
@@ -134,11 +134,14 @@ const char * TimeTicks::to_string()
hseconds = tt;
if ( days ==0)
- sprintf( output_buffer,"%ld:%02ld:%02ld.%02ld", hours, minutes,seconds,hseconds);
+ ACE_OS::sprintf( output_buffer,"%ld:%02ld:%02ld.%02ld", hours,
+ minutes,seconds,hseconds);
else if ( days==1)
- sprintf( output_buffer,"1 day %ld:%02ld:%02ld.%02ld", hours, minutes,seconds,hseconds);
+ ACE_OS::sprintf( output_buffer,"1 day %ld:%02ld:%02ld.%02ld", hours,
+ minutes,seconds,hseconds);
else
- sprintf( output_buffer,"%ld days, %ld:%02ld:%02ld.%02ld", days,hours, minutes,seconds,hseconds);
+ ACE_OS::sprintf( output_buffer,"%ld days, %ld:%02ld:%02ld.%02ld",
+ days,hours, minutes,seconds, hseconds);
return output_buffer;
}
diff --git a/ACE/ASNMP/asnmp/transaction.cpp b/ACE/ASNMP/asnmp/transaction.cpp
index 2f29cf79544..de3afcf8a36 100644
--- a/ACE/ASNMP/asnmp/transaction.cpp
+++ b/ACE/ASNMP/asnmp/transaction.cpp
@@ -69,7 +69,7 @@ int transaction::run()
while (!done) {
- if ((rc = send()) < 0) // send pkt to agent
+ if ((rc = this->send()) < 0) // send pkt to agent
return rc;
else {
if (retry_counter++ > params_.get_retry())
@@ -110,7 +110,7 @@ int transaction::run(transaction_result * r)
if (reactor->schedule_timer(this, 0, to, to) < 0)
return SNMP_CLASS_INTERNAL_ERROR;
- if ((rc = send()) < 0) // send pkt to agent
+ if ((rc = this->send()) < 0) // send pkt to agent
return rc;
return 0;
}
@@ -139,7 +139,7 @@ int transaction::handle_input (ACE_HANDLE)
int transaction::handle_timeout(const ACE_Time_Value &,
const void *)
{
- if (send() < 0) // send pkt to agent
+ if (this->send() < 0) // send pkt to agent
result_->result(this, 0);
else
if (retry_counter_++ > params_.get_retry())
diff --git a/ACE/ASNMP/asnmp/wpdu.cpp b/ACE/ASNMP/asnmp/wpdu.cpp
index d05a750970f..f6c14e6aac9 100644
--- a/ACE/ASNMP/asnmp/wpdu.cpp
+++ b/ACE/ASNMP/asnmp/wpdu.cpp
@@ -18,8 +18,9 @@
// ============================================================================
#include "asnmp/wpdu.h"
-#include <ace/Log_Msg.h>
+#include "ace/Log_Msg.h"
#include "ace/OS_NS_string.h"
+#include "ace/OS_NS_stdio.h"
#define DEFINE_TRAP_CONSTANTS_
#include "asnmp/enttraps.h"
@@ -254,8 +255,8 @@ void wpdu::copy_iovec(iovec& dest, const iovec& src)
if (&dest == &src)
return;
- ACE_OS:: memmove( dest.iov_base, src.iov_base, src.iov_len);
- dest.iov_len = src.iov_len;
+ ACE_OS::memmove( dest.iov_base, src.iov_base, src.iov_len);
+ dest.iov_len = src.iov_len;
}
int wpdu::convert_vb_to_smival( Vb &tempvb, SmiVALUE *smival )
@@ -462,12 +463,12 @@ int wpdu::restore_vbs(Pdu& pdu, const snmp_pdu *raw_pdu) const
case sNMP_SYNTAX_IPADDR:
{
char buffer[20];
- sprintf( buffer,"%d.%d.%d.%d",
- vp->val.string[0],
- vp->val.string[1],
- vp->val.string[2],
- vp->val.string[3]);
- IpAddress ipaddress( buffer);
+ ACE_OS::sprintf( buffer,"%d.%d.%d.%d",
+ vp->val.string[0],
+ vp->val.string[1],
+ vp->val.string[2],
+ vp->val.string[3]);
+ IpAddress ipaddress( buffer);
tempvb.set_value( ipaddress);
}
break;
diff --git a/ACE/ASNMP/examples/get/get.cpp b/ACE/ASNMP/examples/get/get.cpp
index ff6fcb9681f..1829c381442 100644
--- a/ACE/ASNMP/examples/get/get.cpp
+++ b/ACE/ASNMP/examples/get/get.cpp
@@ -171,7 +171,11 @@ int getapp::run()
const char *name = address_.resolve_hostname(rc);
cout << "Device: " << address_ << " ";
+
+ //FUZZ: disable check_for_lack_ACE_OS
cout << (rc ? "<< did not resolve via gethostbyname() >>" : name) << "\n";
+ //FUZZ: enable check_for_lack_ACE_OS
+
cout << "[ Retries=" << target_.get_retry() << " \
Timeout=" << target_.get_timeout() <<" ms " << "Community=" << \
community_.to_string() << " ]"<< endl;
diff --git a/ACE/ASNMP/examples/get/get_async.cpp b/ACE/ASNMP/examples/get/get_async.cpp
index 8217ffabac1..163d559f58e 100644
--- a/ACE/ASNMP/examples/get/get_async.cpp
+++ b/ACE/ASNMP/examples/get/get_async.cpp
@@ -171,7 +171,11 @@ int getapp::run()
const char *name = address_.resolve_hostname(rc);
cout << "Device: " << address_ << " ";
+
+ //FUZZ: disable check_for_lack_ACE_OS
cout << (rc ? "<< did not resolve via gethostbyname() >>" : name) << "\n";
+ //FUZZ: enable check_for_lack_ACE_OS
+
cout << "[ Retries=" << target_.get_retry() << " \
Timeout=" << target_.get_timeout() <<" ms " << "Community=" << \
community_.to_string() << " ]"<< endl;
diff --git a/ACE/ASNMP/examples/next/next.cpp b/ACE/ASNMP/examples/next/next.cpp
index 7a9a2208ca2..a246c1ce549 100644
--- a/ACE/ASNMP/examples/next/next.cpp
+++ b/ACE/ASNMP/examples/next/next.cpp
@@ -170,7 +170,11 @@ int nextapp::run()
const char *name = address_.resolve_hostname(rc);
cout << "Device: " << address_ << " ";
+
+ //FUZZ: disable check_for_lack_ACE_OS
cout << (rc ? "<< did not resolve via gethostbyname() >>" : name) << "\n";
+ //FUZZ: enable check_for_lack_ACE_OS
+
cout << "[ Retries=" << target_.get_retry() << " \
Timeout=" << target_.get_timeout() <<" ms " << "Community=" << \
community_.to_string() << " ]"<< endl;
diff --git a/ACE/ASNMP/examples/set/set.cpp b/ACE/ASNMP/examples/set/set.cpp
index 39eb447f9a7..8cd8752f48a 100644
--- a/ACE/ASNMP/examples/set/set.cpp
+++ b/ACE/ASNMP/examples/set/set.cpp
@@ -241,7 +241,11 @@ int set::run()
const char *name = address_.resolve_hostname(rc);
cout << "Device: " << address_ << " ";
+
+ //FUZZ: disable check_for_lack_ACE_OS
cout << (rc ? "<< did not resolve via gethostbyname() >>" : name) << "\n";
+ //FUZZ: enable check_for_lack_ACE_OS
+
cout << "[ Retries=" << target_.get_retry() << " \
Timeout=" << target_.get_timeout() <<" ms " << "Community=" << \
community_.to_string() << " ]"<< endl;
diff --git a/ACE/ASNMP/examples/trap/trap.cpp b/ACE/ASNMP/examples/trap/trap.cpp
index 59d4f9f25bc..29ef6e4b7d8 100644
--- a/ACE/ASNMP/examples/trap/trap.cpp
+++ b/ACE/ASNMP/examples/trap/trap.cpp
@@ -171,7 +171,11 @@ int trapapp::run()
const char *name = address_.resolve_hostname(rc);
cout << "Device: " << address_ << " ";
+
+ //FUZZ: disable check_for_lack_ACE_OS
cout << (rc ? "<< did not resolve via gethostbyname() >>" : name) << "\n";
+ //FUZZ: enable check_for_lack_ACE_OS
+
cout << "[ Community=" << community_.to_string() << " ]"<< endl;
if (snmp_.trap( pdu_, target_) == SNMP_CLASS_SUCCESS) {
diff --git a/ACE/ASNMP/examples/walk/walk.cpp b/ACE/ASNMP/examples/walk/walk.cpp
index 56fc112fd71..2e67e2b4438 100644
--- a/ACE/ASNMP/examples/walk/walk.cpp
+++ b/ACE/ASNMP/examples/walk/walk.cpp
@@ -240,7 +240,11 @@ int walkapp::run()
const char *name = address_.resolve_hostname(rc);
cout << "Device: " << address_ << " ";
+
+ //FUZZ: disable check_for_lack_ACE_OS
cout << (rc ? "<< did not resolve via gethostbyname() >>" : name) << "\n";
+ //FUZZ: enable check_for_lack_ACE_OS
+
cout << "[ Retries=" << target_.get_retry() << " \
Timeout=" << target_.get_timeout() <<" ms " << "Community=" << \
community_.to_string() << " ]"<< endl;
diff --git a/ACE/ASNMP/tests/Address_Test.cpp b/ACE/ASNMP/tests/Address_Test.cpp
index fce2067ab31..e0bb5598643 100644
--- a/ACE/ASNMP/tests/Address_Test.cpp
+++ b/ACE/ASNMP/tests/Address_Test.cpp
@@ -40,6 +40,7 @@ DAMAGES.
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/
#include "ace/OS_main.h"
+#include "ace/OS_NS_string.h"
#include "asnmp/address.h"
#include "test_config.h"
@@ -260,7 +261,7 @@ static void TestNetbiosAddress()
n1 = n4;
ACE_ASSERT(n1 == n4);
- ACE_ASSERT(strcmp((const char *)n1, (const char *)n4) == 0);
+ ACE_ASSERT(ACE_OS::strcmp((const char *)n1, (const char *)n4) == 0);
n1.set_service_type(nb_server);
ACE_ASSERT(nb_server == n1.get_service_type());
diff --git a/ACE/ChangeLog b/ACE/ChangeLog
index b617d1402e5..0215f03b410 100644
--- a/ACE/ChangeLog
+++ b/ACE/ChangeLog
@@ -1,3 +1,27 @@
+Sat Jun 30 04:48:34 UTC 2007 Abdullah Sowayan <abdullah.sowayan@lmco.com>
+
+ * ASNMP/asnmp/address.cpp:
+ * ASNMP/asnmp/ctr64.cpp:
+ * ASNMP/asnmp/integer.cpp:
+ * ASNMP/asnmp/octet.cpp:
+ * ASNMP/asnmp/oid.cpp:
+ * ASNMP/asnmp/pdu.cpp:
+ * ASNMP/asnmp/target.cpp:
+ * ASNMP/asnmp/timetick.cpp:
+ * ASNMP/asnmp/transaction.cpp:
+ * ASNMP/asnmp/wpdu.cpp:
+ * ASNMP/examples/get/get.cpp:
+ * ASNMP/examples/get/get_async.cpp:
+ * ASNMP/examples/next/next.cpp:
+ * ASNMP/examples/set/set.cpp:
+ * ASNMP/examples/trap/trap.cpp:
+ * ASNMP/examples/walk/walk.cpp:
+ * ASNMP/tests/Address_Test.cpp:
+
+ Fixed ACE_OS fuzz warnings. Use ACE_OS calls instead of raw OS function
+ where possible. If fuzz detected a false-positive, then disable
+ the ACE_OS fuzz check for that section of the code.
+
Fri Jun 29 19:40:27 UTC 2007 Steve Huston <shuston@riverace.com>
* bin/PerlACE/Process_Unix.pm: Don't hang waiting for a failed spawn