diff options
-rw-r--r-- | ACE/ASNMP/asnmp/wpdu.cpp | 7 | ||||
-rw-r--r-- | ACE/ChangeLog | 7 |
2 files changed, 13 insertions, 1 deletions
diff --git a/ACE/ASNMP/asnmp/wpdu.cpp b/ACE/ASNMP/asnmp/wpdu.cpp index e99ab66821e..503ed66f283 100644 --- a/ACE/ASNMP/asnmp/wpdu.cpp +++ b/ACE/ASNMP/asnmp/wpdu.cpp @@ -98,12 +98,17 @@ wpdu::wpdu(const Pdu& pdu, const UdpTarget& target): ACE_NEW(iovec_.iov_base, char [iovec_.iov_len]); // create raw byte stream + // The intermediate integer is to avoid type-punned pointer + // dereferencing. + int out_length = iovec_.iov_len; status = cmu_snmp::build( raw_pdu, (unsigned char *)iovec_.iov_base, - (int *) &iovec_.iov_len, + &out_length, target.get_version(), comm_str.data(), comm_str.length()); + iovec_.iov_len = out_length; + if ( status != 0) { valid_flag_ = SNMP_ERROR_WRONG_ENCODING; cmu_snmp::free_pdu( raw_pdu); diff --git a/ACE/ChangeLog b/ACE/ChangeLog index 50632bf09b7..7216b9ee9ad 100644 --- a/ACE/ChangeLog +++ b/ACE/ChangeLog @@ -1,3 +1,10 @@ +Tue Mar 25 18:02:52 UTC 2008 Chad Elliott <elliott_c@ociweb.com> + + * ASNMP/asnmp/wpdu.cpp: + + Added an intermediate integer to avoid type-punned pointer + dereferencing. + Tue Mar 25 14:19:31 UTC 2008 Adam Mitz <mitza@ociweb.com> * bin/MakeProjectCreator/templates/gnu.mpd: |