1
0
mirror of https://github.com/mfontanini/libtins synced 2026-01-27 04:11:35 +01:00

Added malformed_packet exception. Every class except Dot11* use it.

This commit is contained in:
Matias Fontanini
2013-04-18 00:12:20 -03:00
parent 923f51ae15
commit 3fd1b3d37d
53 changed files with 267 additions and 159 deletions

View File

@@ -30,6 +30,7 @@
#include <cstring>
#include <cassert>
#include "stp.h"
#include "exceptions.h"
namespace Tins {
@@ -42,7 +43,7 @@ STP::STP()
STP::STP(const uint8_t *buffer, uint32_t total_sz)
{
if(total_sz < sizeof(_header))
throw std::runtime_error("Not enough size.");
throw malformed_packet();
std::memcpy(&_header, buffer ,sizeof(_header));
}