Skip to content

Commit d5515db

Browse files
authored
fix: Handle Parsing Error (#8447)
Signed-off-by: J Wyman <[email protected]>
1 parent 8d0b87a commit d5515db

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/http_server.cc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2361,6 +2361,16 @@ HTTPAPIServer::GetContentLength(
23612361
", got: " + content_length_c_str)
23622362
.c_str());
23632363
}
2364+
catch (const std::out_of_range& oor) {
2365+
err = TRITONSERVER_ErrorNew(
2366+
TRITONSERVER_ERROR_INVALID_ARG,
2367+
(std::string("Unable to parse ") + kContentLengthHeader +
2368+
", value is out of range [ " +
2369+
std::to_string(std::numeric_limits<std::int32_t>::min()) + ", " +
2370+
std::to_string(std::numeric_limits<std::int32_t>::max()) +
2371+
" ], got: " + content_length_c_str)
2372+
.c_str());
2373+
}
23642374
}
23652375
} else {
23662376
// The Content-Length doesn't reflect the actual request body size

0 commit comments

Comments
 (0)