Skip to content

Commit 5ae91e8

Browse files
authored
Catch potential out of range exception (#8637)
Catch a potential out-of-range exception that can occur when parsing Accept-Encoding type weights. TRI-633
1 parent 3ce91be commit 5ae91e8

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/http_server.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1093,7 +1093,12 @@ CompressionTypeUsed(const std::string accept_encoding)
10931093
try {
10941094
type_weight = std::stod(encoding.substr(weight_pos + 3));
10951095
}
1096+
catch (const std::out_of_range& oor) {
1097+
type_weight = 0;
1098+
continue;
1099+
}
10961100
catch (const std::invalid_argument& ia) {
1101+
type_weight = 0;
10971102
continue;
10981103
}
10991104
}

0 commit comments

Comments
 (0)