Skip to content

Commit

Permalink
Added package length check
Browse files Browse the repository at this point in the history
  • Loading branch information
Grumbel committed Nov 17, 2015
1 parent 8e31a6a commit 6bd12ed
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions udraw_decoder.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,12 @@ class UDrawDecoder
UDrawDecoder(uint8_t* data, int len) :
m_data(data), m_len(len)
{
if (m_len < 19)
{
std::ostringstream out;
out << "package size to small: " << m_len;
throw std::runtime_error(out.str());
}
}

int get_x() const
Expand Down

0 comments on commit 6bd12ed

Please sign in to comment.