diff options
author | jeff <jeff@FreeBSD.org> | 2003-04-02 22:53:52 +0000 |
---|---|---|
committer | jeff <jeff@FreeBSD.org> | 2003-04-02 22:53:52 +0000 |
commit | de8dcf74da6f877502c92f233c1c8020975a826f (patch) | |
tree | a89fccd25c7ea849cc73eaca30cd1882c5fc4fb0 | |
parent | 3997bed507397508c7f8fa7197c35286598a5170 (diff) | |
download | FreeBSD-src-de8dcf74da6f877502c92f233c1c8020975a826f.zip FreeBSD-src-de8dcf74da6f877502c92f233c1c8020975a826f.tar.gz |
- Don't overrun the ldt buffer.
Submitted by: gordan@freebsd.org
-rw-r--r-- | lib/libthr/arch/i386/i386/_setcurthread.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libthr/arch/i386/i386/_setcurthread.c b/lib/libthr/arch/i386/i386/_setcurthread.c index 2e8150f..7eac3ba 100644 --- a/lib/libthr/arch/i386/i386/_setcurthread.c +++ b/lib/libthr/arch/i386/i386/_setcurthread.c @@ -50,10 +50,10 @@ ldt_init(void) ldt_free = &ldt_entries[NLDT]; - for (i = 0; i < MAXTHR; i++) + for (i = 0; i < MAXTHR - 1; i++) ldt_entries[i] = (void *)&ldt_entries[i + 1]; - ldt_entries[MAXTHR] = NULL; + ldt_entries[MAXTHR - 1] = NULL; ldt_inited = 1; } |