diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc b/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc --- a/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc +++ b/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc @@ -7748,8 +7748,7 @@ for (char **pp = p->p_aliases; *pp; ++pp, ++pp_size) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, *pp, internal_strlen(*pp) + 1); - COMMON_INTERCEPTOR_WRITE_RANGE(ctx, p->p_aliases, - pp_size * sizeof(char **)); + COMMON_INTERCEPTOR_WRITE_RANGE(ctx, p->p_aliases, pp_size * sizeof(char *)); } INTERCEPTOR(struct __sanitizer_protoent *, getprotoent) { @@ -7855,8 +7854,7 @@ for (char **nn = n->n_aliases; *nn; ++nn, ++nn_size) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, *nn, internal_strlen(*nn) + 1); - COMMON_INTERCEPTOR_WRITE_RANGE(ctx, n->n_aliases, - nn_size * sizeof(char **)); + COMMON_INTERCEPTOR_WRITE_RANGE(ctx, n->n_aliases, nn_size * sizeof(char *)); } return n; } @@ -7877,8 +7875,7 @@ for (char **nn = n->n_aliases; *nn; ++nn, ++nn_size) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, *nn, internal_strlen(*nn) + 1); - COMMON_INTERCEPTOR_WRITE_RANGE(ctx, n->n_aliases, - nn_size * sizeof(char **)); + COMMON_INTERCEPTOR_WRITE_RANGE(ctx, n->n_aliases, nn_size * sizeof(char *)); } return n; } @@ -7897,8 +7894,7 @@ for (char **nn = n->n_aliases; *nn; ++nn, ++nn_size) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, *nn, internal_strlen(*nn) + 1); - COMMON_INTERCEPTOR_WRITE_RANGE(ctx, n->n_aliases, - nn_size * sizeof(char **)); + COMMON_INTERCEPTOR_WRITE_RANGE(ctx, n->n_aliases, nn_size * sizeof(char *)); } return n; } diff --git a/compiler-rt/test/sanitizer_common/TestCases/Linux/netent.cpp b/compiler-rt/test/sanitizer_common/TestCases/Linux/netent.cpp --- a/compiler-rt/test/sanitizer_common/TestCases/Linux/netent.cpp +++ b/compiler-rt/test/sanitizer_common/TestCases/Linux/netent.cpp @@ -23,6 +23,11 @@ assert(ntp && ntp->n_name); assert(ntp->n_addrtype == 2); assert(ntp->n_net == 127); + char **aliases = ntp->n_aliases; + while (aliases) { + printf("%s\n", *aliases); + aliases++; + } endnetent(); } @@ -31,6 +36,11 @@ assert(ntp && ntp->n_name); assert(ntp->n_addrtype == 2); assert(ntp->n_net == 127); + char **aliases = ntp->n_aliases; + while (aliases) { + printf("%s\n", *aliases); + aliases++; + } endnetent(); } @@ -41,6 +51,11 @@ assert(ntp && ntp->n_name); assert(ntp->n_addrtype == 2); assert(ntp->n_net == 127); + char **aliases = ntp->n_aliases; + while (aliases) { + printf("%s\n", *aliases); + aliases++; + } endnetent(); } diff --git a/compiler-rt/test/sanitizer_common/TestCases/Linux/protoent.cpp b/compiler-rt/test/sanitizer_common/TestCases/Linux/protoent.cpp --- a/compiler-rt/test/sanitizer_common/TestCases/Linux/protoent.cpp +++ b/compiler-rt/test/sanitizer_common/TestCases/Linux/protoent.cpp @@ -15,6 +15,11 @@ struct protoent *ptp = getprotoent(); assert(ptp && ptp->p_name); assert(ptp->p_proto == 0); + char **aliases = ptp->p_aliases; + while (aliases) { + printf("%s\n", *aliases); + aliases++; + } endprotoent(); } @@ -22,6 +27,11 @@ struct protoent *ptp = getprotobyname("tcp"); assert(ptp && ptp->p_name); assert(ptp->p_proto == 6); + char **aliases = ptp->p_aliases; + while (aliases) { + printf("%s\n", *aliases); + aliases++; + } endprotoent(); } @@ -29,6 +39,11 @@ struct protoent *ptp = getprotobynumber(1); assert(ptp && ptp->p_name); assert(ptp->p_proto == 1); + char **aliases = ptp->p_aliases; + while (aliases) { + printf("%s\n", *aliases); + aliases++; + } endprotoent(); }