Skip to content

Commit 3a98f4d

Browse files
committed
[msan] Fix gethostent tests
gethostent should follow sethostent.
1 parent 64f878d commit 3a98f4d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

compiler-rt/lib/msan/tests/msan_test.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1114,6 +1114,7 @@ TEST_P(MemorySanitizerIpTest, recvmsg) {
11141114
} while (0)
11151115

11161116
TEST(MemorySanitizer, gethostent) {
1117+
sethostent(0);
11171118
struct hostent *he = gethostent();
11181119
ASSERT_NE((void *)NULL, he);
11191120
EXPECT_HOSTENT_NOT_POISONED(he);
@@ -1177,6 +1178,7 @@ TEST(MemorySanitizer, gethostbyaddr) {
11771178

11781179
#if !defined(__NetBSD__)
11791180
TEST(MemorySanitizer, gethostent_r) {
1181+
sethostent(0);
11801182
char buf[2000];
11811183
struct hostent he;
11821184
struct hostent *result;

0 commit comments

Comments
 (0)