diff options
author | elliott_c <elliott_c@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2008-03-25 17:59:42 +0000 |
---|---|---|
committer | elliott_c <elliott_c@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2008-03-25 17:59:42 +0000 |
commit | d92760fbb9f99e0e1e2743183ce95562f707dec3 (patch) | |
tree | cba5dab8c5aa03ca55a5a37e9e004106a2061b90 /ACE/ASNMP | |
parent | 3239194c32bdb94c3337718926b7c3ccc0801c29 (diff) | |
download | ATCD-d92760fbb9f99e0e1e2743183ce95562f707dec3.tar.gz |
ChangeLogTag: Tue Mar 25 18:02:52 UTC 2008 Chad Elliott <elliott_c@ociweb.com>
Diffstat (limited to 'ACE/ASNMP')
-rw-r--r-- | ACE/ASNMP/asnmp/wpdu.cpp | 7 |
1 files changed, 6 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); |