diff options
author | mtm <mtm@FreeBSD.org> | 2003-05-06 02:33:49 +0000 |
---|---|---|
committer | mtm <mtm@FreeBSD.org> | 2003-05-06 02:33:49 +0000 |
commit | bbd203a2167bb625ecc13db26f17f3246b91f7f1 (patch) | |
tree | 38b581fc22903140dc84cb55dd9e292ee8becf58 /lib | |
parent | da28dc62d70922594e0170d771312b4fb8455eaa (diff) | |
download | FreeBSD-src-bbd203a2167bb625ecc13db26f17f3246b91f7f1.zip FreeBSD-src-bbd203a2167bb625ecc13db26f17f3246b91f7f1.tar.gz |
Fix a null dereference leading to a core dump when
the number of threads exceeds the number of open slots
in ldt_entries[].
Approved by: markm (mentor)(implicit)
Reviewed by: jeff
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libthr/arch/i386/i386/_setcurthread.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/libthr/arch/i386/i386/_setcurthread.c b/lib/libthr/arch/i386/i386/_setcurthread.c index 29cd646..94c6561 100644 --- a/lib/libthr/arch/i386/i386/_setcurthread.c +++ b/lib/libthr/arch/i386/i386/_setcurthread.c @@ -62,7 +62,10 @@ ldt_init(void) void _retire_thread(void *entry) { - *(void **)entry = *ldt_free; + if (ldt_free == NULL) + *(void **)entry = NULL; + else + *(void **)entry = *ldt_free; ldt_free = entry; } |