From 5d6bb74bf6d6e30957a5a3d609d353a07c9467c9 Mon Sep 17 00:00:00 2001 From: Alex Hultman Date: Fri, 19 Feb 2021 05:20:28 +0100 Subject: [PATCH] Fix overflowing conversion to int in getParameter --- src/HttpParser.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/HttpParser.h b/src/HttpParser.h index 2a9e774..5017548 100644 --- a/src/HttpParser.h +++ b/src/HttpParser.h @@ -136,7 +136,9 @@ public: currentParameters = parameters; } - std::string_view getParameter(unsigned int index) { + /* This one should take unsigned int, but really high numbers will + * overflow as int, so just accept int for now */ + std::string_view getParameter(/*unsigned */int index) { if (currentParameters.first < (int) index) { return {}; } else {