Skip to content

Commit a249138

Browse files
authored
Fix Undefined-shift in pcpp::SmtpRequestLayer::getCommand (#1553)
* Fix Undefined-shift in pcpp::SmtpRequestLayer::getCommand * update
1 parent a600a70 commit a249138

File tree

2 files changed

+1
-1
lines changed

2 files changed

+1
-1
lines changed

Packet++/src/SmtpLayer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ namespace pcpp
1717
size_t val = 0;
1818
std::string field = getCommandString();
1919

20-
for (size_t idx = 0; idx < field.size(); ++idx)
20+
for (size_t idx = 0; idx < std::min(field.size(), static_cast<size_t>(8)); ++idx)
2121
{
2222
val |= static_cast<size_t>(field.c_str()[idx]) << (idx * 8);
2323
}
105 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)