OSDN Git Service

Merge "Workaround ASan false positive in RouteController." into nyc-dev
authorJon Larimer <jlarimer@google.com>
Mon, 11 Apr 2016 16:43:41 +0000 (16:43 +0000)
committerAndroid (Google) Code Review <android-gerrit@google.com>
Mon, 11 Apr 2016 16:43:41 +0000 (16:43 +0000)
server/RouteController.cpp

index b2cd93a..e4b7cc1 100644 (file)
@@ -180,6 +180,15 @@ void updateTableNamesFile() {
 // |iov| is an array of struct iovec that contains the netlink message payload.
 // The netlink header is generated by this function based on |action| and |flags|.
 // Returns -errno if there was an error or if the kernel reported an error.
+
+// Disable optimizations in ASan build.
+// ASan reports an out-of-bounds 32-bit(!) access in the first loop of the
+// function (over iov[]).
+#ifdef __clang__
+#if __has_feature(address_sanitizer)
+__attribute__((optnone))
+#endif
+#endif
 WARN_UNUSED_RESULT int sendNetlinkRequest(uint16_t action, uint16_t flags, iovec* iov, int iovlen) {
     nlmsghdr nlmsg = {
         .nlmsg_type = action,