[compiler-rt] r262210 - [asan] Fix UB in test/asan/TestCases/Linux/recvfrom.cc testcase.
Maxim Ostapenko via llvm-commits
llvm-commits at lists.llvm.org
Mon Feb 29 00:56:26 PST 2016
Author: chefmax
Date: Mon Feb 29 02:56:26 2016
New Revision: 262210
URL: http://llvm.org/viewvc/llvm-project?rev=262210&view=rev
Log:
[asan] Fix UB in test/asan/TestCases/Linux/recvfrom.cc testcase.
Modified:
compiler-rt/trunk/test/asan/TestCases/Linux/recvfrom.cc
Modified: compiler-rt/trunk/test/asan/TestCases/Linux/recvfrom.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/asan/TestCases/Linux/recvfrom.cc?rev=262210&r1=262209&r2=262210&view=diff
==============================================================================
--- compiler-rt/trunk/test/asan/TestCases/Linux/recvfrom.cc (original)
+++ compiler-rt/trunk/test/asan/TestCases/Linux/recvfrom.cc Mon Feb 29 02:56:26 2016
@@ -26,8 +26,8 @@ int sockfd;
static void *client_thread_udp(void *data) {
const char buf[kBufSize] = {0, };
- socklen_t addrlen;
struct sockaddr_in serveraddr;
+ socklen_t addrlen = sizeof(serveraddr);
int succeeded = getsockname(sockfd, (struct sockaddr *)&serveraddr, &addrlen);
CHECK_ERROR(succeeded < 0, "in getsockname");
More information about the llvm-commits
mailing list