Lifang Xia
Lifang Xia
if "ss.ss_family == 10"(A) false, the "IN6_IS_ADDR_V4MAPPED(&sin6.sin6_addr)"(B) should not be executed. "&&" means the condtions should be executed from left to right. from the disassembly, it acctually execute A and...
> this is a clang bug, no? @appujee I think it is not a clang bug. it is a common optimization in the middle IR. Both aarch64 and RISCV will...
> > ok so here is a smaller repro case:https://godbolt.org/z/7b8dbMhvo (note i have renamed memcpy etc to prevent compiler from inlining). Looks like in both the cases (even when reinterpret...
> after i claimed this couldn't happen on Android, the reporter replied: > > > > The address was alloced in [get_ai](https://cs.android.com/android/platform/superproject/+/master:bionic/libc/dns/net/getaddrinfo.c;drc=4aef93acff8932e9fc9a84bc1ccce8903806b193;l=1109). The "afd->a_socklen" would be less then sizeof(struct sockaddr_storage)....
I added some logs in [android_getaddrinfofornetcontext](https://cs.android.com/android/platform/superproject/+/master:bionic/libc/dns/net/getaddrinfo.c;drc=4aef93acff8932e9fc9a84bc1ccce8903806b193;l=586) and [get_ai](https://cs.android.com/android/platform/superproject/+/master:bionic/libc/dns/net/getaddrinfo.c;drc=4aef93acff8932e9fc9a84bc1ccce8903806b193;l=1099), and add a backtrace in the [sockaddrToInetAddress](https://cs.android.com/android/platform/superproject/+/master:libcore/luni/src/main/native/NetworkUtilities.cpp;drc=3a07d772dd4002cf1189e5b42b1efcc241cd0ff0;l=38): ``` +#define TLOGE(...) syslog(LOG_ERR|LOG_AUTH,__VA_ARGS__); + typedef union sockaddr_union { struct sockaddr generic; struct sockaddr_in in;...