From 887bccf0af1bcdc5fc7fefacb69ad7699e346794 Mon Sep 17 00:00:00 2001 From: Matias Fontanini Date: Mon, 8 May 2017 22:22:48 -0700 Subject: [PATCH] Fix undefined std::min use in PPPoE --- src/pppoe.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/pppoe.cpp b/src/pppoe.cpp index e936906..36eccd0 100644 --- a/src/pppoe.cpp +++ b/src/pppoe.cpp @@ -53,7 +53,9 @@ PPPoE::PPPoE(const uint8_t* buffer, uint32_t total_sz) : tags_size_() { InputMemoryStream stream(buffer, total_sz); stream.read(header_); - stream.size(std::min(stream.size(), (size_t)payload_length())); + const uint32_t read_size = stream.size() < payload_length() ? stream.size() + : payload_length(); + stream.size(read_size); // If this is a session data packet if (code() == 0) { if (stream) {