aboutsummaryrefslogtreecommitdiff
path: root/nss/getaddrinfo.c
AgeCommit message (Collapse)AuthorFilesLines
2025-03-12getaddrinfo.c: support MPTCP (BZ #29609)zhenwei pi1-0/+3
There is a lack of MPTCP support from gaih_inet_typeproto array, add MPTCP entry. Signed-off-by: zhenwei pi <zhenwei.pi@linux.dev> Signed-off-by: zhenwei pi <pizhenwei@bytedance.com> Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2025-01-01Update copyright dates with scripts/update-copyrightsPaul Eggert1-1/+1
2024-12-23getaddrinfo.c: Avoid uninitialized pointer access [BZ #32465]H.J. Lu1-23/+22
Add valid_decimal_value to check valid decimal value in a string to avoid uninitialized endp in add_prefixlist and gaiconf_init as reported by Clang 19: ./getaddrinfo.c:1884:11: error: variable 'endp' is used uninitialized whenever '||' condition is true [-Werror,-Wsometimes-uninitialized] 1884 | && (cp == NULL | ^~~~~~~~~~ ./getaddrinfo.c:1887:11: note: uninitialized use occurs here 1887 | && *endp == '\0' | ^~~~ ./getaddrinfo.c:1884:11: note: remove the '||' if its condition is always false 1884 | && (cp == NULL | ^~~~~~~~~~ 1885 | || (bits = strtoul (cp, &endp, 10)) != ULONG_MAX | ~~ ./getaddrinfo.c:1875:13: note: initialize the variable 'endp' to silence this warning 1875 | char *endp; | ^ | = NULL This fixes BZ #32465. Signed-off-by: H.J. Lu <hjl.tools@gmail.com> Reviewed-by: Sam James <sam@gentoo.org>
2024-12-16Use empty initializer to silence GCC 4.9 or olderH.J. Lu1-1/+1
Use empty initializer to silence GCC 4.9 or older: getaddrinfo.c: In function ‘gaih_inet’: getaddrinfo.c:1135:24: error: missing braces around initializer [-Werror=missing-braces] / sizeof (struct gaih_typeproto)] = {0}; ^ Signed-off-by: H.J. Lu <hjl.tools@gmail.com> Reviewed-by: Sam James <sam@gentoo.org>
2024-12-15Revert "Add braces in initializers for GCC 4.9 or older"H.J. Lu1-1/+1
This reverts commit 8aa2a9e0339215012354f3c4a262edda838134e8. as not all targets need braces.
2024-12-14Add braces in initializers for GCC 4.9 or olderH.J. Lu1-1/+1
Add braces to silence GCC 4.9 or older: getaddrinfo.c: In function ‘gaih_inet’: getaddrinfo.c:1135:24: error: missing braces around initializer [-Werror=missing-braces] / sizeof (struct gaih_typeproto)] = {0}; ^ Signed-off-by: H.J. Lu <hjl.tools@gmail.com> Reviewed-by: Sam James <sam@gentoo.org>
2024-11-25Silence most -Wzero-as-null-pointer-constant diagnosticsAlejandro Colomar1-2/+2
Replace 0 by NULL and {0} by {}. Omit a few cases that aren't so trivial to fix. Link: <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117059> Link: <https://software.codidact.com/posts/292718/292759#answer-292759> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-01-02getaddrinfo: translate ENOMEM to EAI_MEMORY (bug 31163)Andreas Schwab1-1/+8
When __resolv_context_get returns NULL due to out of memory, translate it to a return value of EAI_MEMORY.
2024-01-01Update copyright dates with scripts/update-copyrightsPaul Eggert1-1/+1
2023-12-20nss: Remove unused allocation from get_nscd_addresses in getaddrinfoFlorian Weimer1-1/+0
No bug because this is not visible if glibc is built with optimization. Otherwise this would be a critical resource leak. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2023-10-24Move getaddrinfo from 'posix' into 'nss'Arjun Shankar1-0/+2625
getaddrinfo is an entry point for nss functionality. This commit moves it from 'sysdeps/posix' to 'nss', gets rid of the stub in 'posix', and moves all associated tests as well. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>