This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug nss/20874] getaddrinfo_a segfault


https://sourceware.org/bugzilla/show_bug.cgi?id=20874

Florian Weimer <fweimer at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
                 CC|                            |fweimer at redhat dot com
         Resolution|---                         |INVALID
              Flags|                            |security-

--- Comment #1 from Florian Weimer <fweimer at redhat dot com> ---
(In reply to Matt Corallo from comment #0)

> void beatit() {
> 	struct gaicb gai;
> 	struct gaicb *gaip = &gai;
>  
> 	while (1) {
> 		memset(&gai, 0, sizeof(gai));
>  
> 		fprintf(stderr, "OK, cleared gai, now calling gai_a\n");
> 		std::string hostname(host);
> 		gai.ar_name = hostname.c_str();
>  
> 		assert(!getaddrinfo_a(GAI_NOWAIT, &gaip, 1, NULL));

getaddrinfo_a does not make copy of the submitted requests, so this code has
multiple use-after-free issues (the gai local variable, and the backing string
for hostname).

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]