rpc : catch std::length_error in recv_msg (#31204)
This commit is contained in:
1 parent
8542e94350
commit
7ecb57f7ad
1 file changed
+4
-1
@@ -348,7 +348,10 @@ static bool recv_msg(socket_ptr sock, std::vector<uint8_t> & input) {
|
||||
}
|
||||
try {
|
||||
input.resize(size);
|
||||
} catch (const std::bad_alloc & e) {
|
||||
} catch (const std::length_error &) {
|
||||
LOG_ERROR("Failed to allocate input buffer of size %" PRIu64 "\n", size);
|
||||
return false;
|
||||
} catch (const std::bad_alloc &) {
|
||||
LOG_ERROR("Failed to allocate input buffer of size %" PRIu64 "\n", size);
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user