HDFS-15949. Fix integer overflow (#2857)

Reviewed-by: Inigo Goiri <inigoiri@apache.org>
Signed-off-by: Akira Ajisaka <aajisaka@apache.org>
This commit is contained in:
Gautham B A 2021-04-06 14:52:54 +05:30 committed by GitHub
parent 3f2682b92b
commit 36014b8282
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -453,11 +453,11 @@ TEST_F(HdfsExtTest, TestHosts) {
EXPECT_EQ(0, errno);
//Test invalid arguments
EXPECT_EQ(nullptr, hdfsGetHosts(fs, filename.c_str(), 0, std::numeric_limits<int64_t>::max()+1));
EXPECT_EQ(nullptr, hdfsGetHosts(fs, filename.c_str(), 0, std::numeric_limits<int64_t>::min()));
EXPECT_EQ((int) std::errc::invalid_argument, errno);
//Test invalid arguments
EXPECT_EQ(nullptr, hdfsGetHosts(fs, filename.c_str(), std::numeric_limits<int64_t>::max()+1, std::numeric_limits<int64_t>::max()));
EXPECT_EQ(nullptr, hdfsGetHosts(fs, filename.c_str(), std::numeric_limits<int64_t>::min(), std::numeric_limits<int64_t>::max()));
EXPECT_EQ((int) std::errc::invalid_argument, errno);
}