]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Fix off-by-one error with VKI_GDT_TLS_MAX.
authorNicholas Nethercote <n.nethercote@gmail.com>
Thu, 28 Oct 2004 16:53:51 +0000 (16:53 +0000)
committerNicholas Nethercote <n.nethercote@gmail.com>
Thu, 28 Oct 2004 16:53:51 +0000 (16:53 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/branches/VALGRIND_2_2_0_BRANCH@2872

coregrind/vg_ldt.c
include/vg_kerneliface.h

index ba9b245bfe8305ea00b0e0a824c125837336e23e..a22a8e026a3168a155f5fa5b5b60bcd559bb3b33 100644 (file)
@@ -196,7 +196,7 @@ Addr VG_(do_useseg) ( UInt seg_selector, Addr virtual_addr )
    if (table == 0) {
       VgLdtEntry* the_tls;
 
-      vg_assert(seg_selector >= VKI_GDT_TLS_MIN && seg_selector < VKI_GDT_TLS_MAX);
+      vg_assert(seg_selector >= VKI_GDT_TLS_MIN && seg_selector <= VKI_GDT_TLS_MAX);
 
       /* Come up with a suitable GDT entry.  We look at the thread's TLS
         array, which is pointed to by a VG_(baseBlock) entry. */
index 7dc4825302a1c3410052c8aa7209ad35dc1d90b1..04e42c09d37aed7eda7b29aa2cea33b28aed2b6b 100644 (file)
@@ -665,7 +665,7 @@ typedef struct vki_modify_ldt_ldt_s {
 
 #define VKI_GDT_TLS_ENTRIES 3
 #define VKI_GDT_TLS_MIN     6
-#define VKI_GDT_TLS_MAX     (VKI_GDT_TLS_MIN + VKI_GDT_TLS_ENTRIES)
+#define VKI_GDT_TLS_MAX     (VKI_GDT_TLS_MIN + VKI_GDT_TLS_ENTRIES - 1)
 
 /* Flags for clone() */
 /* linux/sched.h */