Skip to content
Browse files

UnregisterPDU: bugfix: upper_bound is an uint32_t

Was an oid before.
  • Loading branch information...
1 parent 6981a65 commit f306781736050b080145488baa8e29491e1760fb @tanjeff committed
Showing with 10 additions and 6 deletions.
  1. +7 −3 src/UnregisterPDU.cpp
  2. +3 −3 src/UnregisterPDU.hpp
View
10 src/UnregisterPDU.cpp
@@ -40,7 +40,11 @@ UnregisterPDU::UnregisterPDU(data_t::const_iterator& pos,
// read r.upper_bound only if r.range_subid is not 0
if( range_subid )
{
- upper_bound = oid(pos, end, big_endian);
+ if(end - pos < 4)
+ {
+ throw(parse_error());
+ }
+ upper_bound = read32(pos, big_endian);
}
}
@@ -58,7 +62,7 @@ data_t UnregisterPDU::serialize() const
if( range_subid )
{
- serialized += upper_bound.serialize();
+ write32(serialized, upper_bound);
}
// Add Header
@@ -70,6 +74,6 @@ data_t UnregisterPDU::serialize() const
UnregisterPDU::UnregisterPDU()
- : priority(127), range_subid(0), subtree(), upper_bound()
+ : priority(127), range_subid(0), subtree(), upper_bound(0)
{
}
View
6 src/UnregisterPDU.hpp
@@ -35,20 +35,20 @@ namespace agentxcpp
byte_t priority;
byte_t range_subid;
oid subtree;
- oid upper_bound;
+ uint32_t upper_bound;
public:
/**
* \brief Set the upper_bound.
*/
- void set_upper_bound(oid upper_bound)
+ void set_upper_bound(uint32_t upper_bound)
{
this->upper_bound = upper_bound;
}
/**
* \brief Get the upper_bound.
*/
- oid get_upper_bound()
+ uint32_t get_upper_bound()
{
return this->upper_bound;
}

0 comments on commit f306781

Please sign in to comment.
Something went wrong with that request. Please try again.