Merge "Nullability check for socket module." am: 6045af2931

Original change: https://android-review.googlesource.com/c/platform/bionic/+/2623713

Change-Id: I0e2ca12bd314f3dd1242359da8f1cdb7aaf6ed95
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Treehugger Robot 2023-06-14 01:44:17 +00:00 committed by Automerger Merge Worker
commit fe05401ae1

View file

@ -30,15 +30,15 @@
#error "Never include this file directly; instead, include <sys/socket.h>"
#endif
extern ssize_t __sendto_chk(int, const void*, size_t, size_t, int, const struct sockaddr*,
extern ssize_t __sendto_chk(int, const void* _Nonnull, size_t, size_t, int, const struct sockaddr* _Nullable,
socklen_t) __INTRODUCED_IN(26);
ssize_t __recvfrom_chk(int, void*, size_t, size_t, int, struct sockaddr*,
socklen_t*) __INTRODUCED_IN(21);
ssize_t __recvfrom_chk(int, void* _Nullable, size_t, size_t, int, struct sockaddr* _Nullable,
socklen_t* _Nullable) __INTRODUCED_IN(21);
#if defined(__BIONIC_FORTIFY)
__BIONIC_FORTIFY_INLINE
ssize_t recvfrom(int fd, void* const buf __pass_object_size0, size_t len, int flags, struct sockaddr* src_addr, socklen_t* addr_len)
ssize_t recvfrom(int fd, void* _Nullable const buf __pass_object_size0, size_t len, int flags, struct sockaddr* _Nullable src_addr, socklen_t* _Nullable addr_len)
__overloadable
__clang_error_if(__bos_unevaluated_lt(__bos0(buf), len),
"'recvfrom' called with size bigger than buffer") {
@ -53,7 +53,7 @@ ssize_t recvfrom(int fd, void* const buf __pass_object_size0, size_t len, int fl
}
__BIONIC_FORTIFY_INLINE
ssize_t sendto(int fd, const void* const buf __pass_object_size0, size_t len, int flags, const struct sockaddr* dest_addr, socklen_t addr_len)
ssize_t sendto(int fd, const void* _Nonnull const buf __pass_object_size0, size_t len, int flags, const struct sockaddr* _Nullable dest_addr, socklen_t addr_len)
__overloadable
__clang_error_if(__bos_unevaluated_lt(__bos0(buf), len),
"'sendto' called with size bigger than buffer") {
@ -68,7 +68,7 @@ ssize_t sendto(int fd, const void* const buf __pass_object_size0, size_t len, in
}
__BIONIC_FORTIFY_INLINE
ssize_t recv(int socket, void* const buf __pass_object_size0, size_t len, int flags)
ssize_t recv(int socket, void* _Nullable const buf __pass_object_size0, size_t len, int flags)
__overloadable
__clang_error_if(__bos_unevaluated_lt(__bos0(buf), len),
"'recv' called with size bigger than buffer") {
@ -76,7 +76,7 @@ ssize_t recv(int socket, void* const buf __pass_object_size0, size_t len, int fl
}
__BIONIC_FORTIFY_INLINE
ssize_t send(int socket, const void* const buf __pass_object_size0, size_t len, int flags)
ssize_t send(int socket, const void* _Nonnull const buf __pass_object_size0, size_t len, int flags)
__overloadable
__clang_error_if(__bos_unevaluated_lt(__bos0(buf), len),
"'send' called with size bigger than buffer") {