* [PATCH] NULL pointer access in _dl_allocate_tls_init.
@ 2003-01-30 8:29 Martin Schwidefsky
2003-01-30 20:46 ` Roland McGrath
0 siblings, 1 reply; 2+ messages in thread
From: Martin Schwidefsky @ 2003-01-30 8:29 UTC (permalink / raw)
To: libc-hacker
Hi,
if the allocation of storage in allocate_dtv fails a NULL
pointer gets passed to _dl_allocate_tls_init and is accessed
before the check.
blue skies,
Martin.
2003-01-30 Martin Schwidefsky <schwidefsky@de.ibm.com>
* sysdeps/generic/dl-tls.c (_dl_allocate_tls_init): Avoid NULL
pointer access.
diff -urN libc/sysdeps/generic/dl-tls.c libc-fixed/sysdeps/generic/dl-tls.c
--- libc/sysdeps/generic/dl-tls.c Mon Jan 13 10:34:18 2003
+++ libc-fixed/sysdeps/generic/dl-tls.c Wed Jan 29 16:37:37 2003
@@ -329,7 +329,7 @@
internal_function
_dl_allocate_tls_init (void *result)
{
- dtv_t *dtv = GET_DTV (result);
+ dtv_t *dtv;
struct dtv_slotinfo_list *listp;
size_t total = 0;
@@ -337,6 +337,8 @@
/* The memory allocation failed. */
return NULL;
+ dtv = GET_DTV (result);
+
/* We have to look prepare the dtv for all currently loaded
modules using TLS. For those which are dynamically loaded we
add the values indicating deferred allocation. */
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] NULL pointer access in _dl_allocate_tls_init.
2003-01-30 8:29 [PATCH] NULL pointer access in _dl_allocate_tls_init Martin Schwidefsky
@ 2003-01-30 20:46 ` Roland McGrath
0 siblings, 0 replies; 2+ messages in thread
From: Roland McGrath @ 2003-01-30 20:46 UTC (permalink / raw)
To: Martin Schwidefsky; +Cc: libc-hacker
Thanks, I put the fix in.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2003-01-30 20:46 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-01-30 8:29 [PATCH] NULL pointer access in _dl_allocate_tls_init Martin Schwidefsky
2003-01-30 20:46 ` Roland McGrath
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).