public inbox for libc-hacker@sourceware.org
 help / color / mirror / Atom feed
From: Martin Schwidefsky <schwidefsky@de.ibm.com>
To: libc-hacker@sources.redhat.com
Subject: [PATCH] NULL pointer access in _dl_allocate_tls_init.
Date: Thu, 30 Jan 2003 08:29:00 -0000	[thread overview]
Message-ID: <200301300926.52908.schwidefsky@de.ibm.com> (raw)

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.  */

             reply	other threads:[~2003-01-30  8:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-01-30  8:29 Martin Schwidefsky [this message]
2003-01-30 20:46 ` Roland McGrath

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200301300926.52908.schwidefsky@de.ibm.com \
    --to=schwidefsky@de.ibm.com \
    --cc=libc-hacker@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).