public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc/siddhesh/gai-cleanup2] gethosts: Return EAI_MEMORY on allocation failure
@ 2022-03-08 14:10 Siddhesh Poyarekar
  0 siblings, 0 replies; 4+ messages in thread
From: Siddhesh Poyarekar @ 2022-03-08 14:10 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=b57bf811e56ede85a5c073331ca52380278bd10c

commit b57bf811e56ede85a5c073331ca52380278bd10c
Author: Siddhesh Poyarekar <siddhesh@sourceware.org>
Date:   Wed Mar 2 11:45:29 2022 +0530

    gethosts: Return EAI_MEMORY on allocation failure
    
    All other cases of failures due to lack of memory return EAI_MEMORY, so
    it seems wrong to return EAI_SYSTEM here.  The only reason
    convert_hostent_to_gaih_addrtuple could fail is on calloc failure.
    
    Signed-off-by: Siddhesh Poyarekar <siddhesh@sourceware.org>

Diff:
---
 sysdeps/posix/getaddrinfo.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c
index eebed824a8..5cd988bec5 100644
--- a/sysdeps/posix/getaddrinfo.c
+++ b/sysdeps/posix/getaddrinfo.c
@@ -303,13 +303,13 @@ gethosts (nss_gethostbyname3_r fct, int family, const char *name,
   else if (status == NSS_STATUS_SUCCESS)
     {
       if (!convert_hostent_to_gaih_addrtuple (req, family, &th, res))
-	return -EAI_SYSTEM;
+	return -EAI_MEMORY;
 
       if (localcanon != NULL && res->canon == NULL)
 	{
 	  char *canonbuf = __strdup (localcanon);
 	  if (canonbuf == NULL)
-	    return  -EAI_SYSTEM;
+	    return  -EAI_MEMORY;
 	  res->canon = canonbuf;
 	}
     }


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [glibc/siddhesh/gai-cleanup2] gethosts: Return EAI_MEMORY on allocation failure
@ 2022-03-14 14:17 Siddhesh Poyarekar
  0 siblings, 0 replies; 4+ messages in thread
From: Siddhesh Poyarekar @ 2022-03-14 14:17 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=0b1d57fcdc08619f49e6e1769601b9e5fa7d0779

commit 0b1d57fcdc08619f49e6e1769601b9e5fa7d0779
Author: Siddhesh Poyarekar <siddhesh@sourceware.org>
Date:   Wed Mar 2 11:45:29 2022 +0530

    gethosts: Return EAI_MEMORY on allocation failure
    
    All other cases of failures due to lack of memory return EAI_MEMORY, so
    it seems wrong to return EAI_SYSTEM here.  The only reason
    convert_hostent_to_gaih_addrtuple could fail is on calloc failure.
    
    Signed-off-by: Siddhesh Poyarekar <siddhesh@sourceware.org>

Diff:
---
 sysdeps/posix/getaddrinfo.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c
index eebed824a8..5cd988bec5 100644
--- a/sysdeps/posix/getaddrinfo.c
+++ b/sysdeps/posix/getaddrinfo.c
@@ -303,13 +303,13 @@ gethosts (nss_gethostbyname3_r fct, int family, const char *name,
   else if (status == NSS_STATUS_SUCCESS)
     {
       if (!convert_hostent_to_gaih_addrtuple (req, family, &th, res))
-	return -EAI_SYSTEM;
+	return -EAI_MEMORY;
 
       if (localcanon != NULL && res->canon == NULL)
 	{
 	  char *canonbuf = __strdup (localcanon);
 	  if (canonbuf == NULL)
-	    return  -EAI_SYSTEM;
+	    return  -EAI_MEMORY;
 	  res->canon = canonbuf;
 	}
     }


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [glibc/siddhesh/gai-cleanup2] gethosts: Return EAI_MEMORY on allocation failure
@ 2022-03-07 16:56 Siddhesh Poyarekar
  0 siblings, 0 replies; 4+ messages in thread
From: Siddhesh Poyarekar @ 2022-03-07 16:56 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=a0eff068c074227182e1b98875081ecc6b88e2cd

commit a0eff068c074227182e1b98875081ecc6b88e2cd
Author: Siddhesh Poyarekar <siddhesh@sourceware.org>
Date:   Wed Mar 2 11:45:29 2022 +0530

    gethosts: Return EAI_MEMORY on allocation failure
    
    All other cases of failures due to lack of memory return EAI_MEMORY, so
    it seems wrong to return EAI_SYSTEM here.  The only reason
    convert_hostent_to_gaih_addrtuple could fail is on calloc failure.
    
    Signed-off-by: Siddhesh Poyarekar <siddhesh@sourceware.org>

Diff:
---
 sysdeps/posix/getaddrinfo.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c
index 6cbbd5dac1..7c7565ac6d 100644
--- a/sysdeps/posix/getaddrinfo.c
+++ b/sysdeps/posix/getaddrinfo.c
@@ -303,13 +303,13 @@ gethosts (nss_gethostbyname3_r fct, int family, const char *name,
   else if (status == NSS_STATUS_SUCCESS)
     {
       if (!convert_hostent_to_gaih_addrtuple (req, family, &th, res))
-	return -EAI_SYSTEM;
+	return -EAI_MEMORY;
 
       if (localcanon != NULL && res->canon == NULL)
 	{
 	  char *canonbuf = __strdup (localcanon);
 	  if (canonbuf == NULL)
-	    return  -EAI_SYSTEM;
+	    return  -EAI_MEMORY;
 	  res->canon = canonbuf;
 	}
     }


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [glibc/siddhesh/gai-cleanup2] gethosts: Return EAI_MEMORY on allocation failure
@ 2022-03-02  6:34 Siddhesh Poyarekar
  0 siblings, 0 replies; 4+ messages in thread
From: Siddhesh Poyarekar @ 2022-03-02  6:34 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=5cbcab03883ec7421fb59d0c79928e878077802b

commit 5cbcab03883ec7421fb59d0c79928e878077802b
Author: Siddhesh Poyarekar <siddhesh@sourceware.org>
Date:   Wed Mar 2 11:45:29 2022 +0530

    gethosts: Return EAI_MEMORY on allocation failure
    
    All other cases of failures due to lack of memory return EAI_MEMORY, so
    it seems wrong to return EAI_SYSTEM here.  The only reason
    convert_hostent_to_gaih_addrtuple could fail is on calloc failure.
    
    Signed-off-by: Siddhesh Poyarekar <siddhesh@sourceware.org>

Diff:
---
 sysdeps/posix/getaddrinfo.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c
index f790921487..f89169dd33 100644
--- a/sysdeps/posix/getaddrinfo.c
+++ b/sysdeps/posix/getaddrinfo.c
@@ -326,7 +326,7 @@ gethosts (nss_gethostbyname3_r fct, const int family, const char *name,
     {
       if (!convert_hostent_to_gaih_addrtuple (req, family, &th, &addrmem))
 	{
-	  result = -EAI_SYSTEM;
+	  result = -EAI_MEMORY;
 	  goto out;
 	}
       if (addrmem && !gaih_lookup_result_push_alloc (res, addrmem))
@@ -339,7 +339,7 @@ gethosts (nss_gethostbyname3_r fct, const int family, const char *name,
 	  char *canonbuf = __strdup (localcanon);
 	  if (canonbuf == NULL)
 	    {
-	      result = -EAI_SYSTEM;
+	      result = -EAI_MEMORY;
 	      goto out;
 	    }
 	  *canonp = canonbuf;


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-03-14 14:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-08 14:10 [glibc/siddhesh/gai-cleanup2] gethosts: Return EAI_MEMORY on allocation failure Siddhesh Poyarekar
  -- strict thread matches above, loose matches on Subject: below --
2022-03-14 14:17 Siddhesh Poyarekar
2022-03-07 16:56 Siddhesh Poyarekar
2022-03-02  6:34 Siddhesh Poyarekar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).