]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Fix elf/tst-tls20 stack OOB access
authorSzabolcs Nagy <szabolcs.nagy@arm.com>
Tue, 11 Oct 2022 12:07:59 +0000 (13:07 +0100)
committerSzabolcs Nagy <szabolcs.nagy@arm.com>
Wed, 12 Oct 2022 11:54:07 +0000 (12:54 +0100)
Off-by-one error found on morello with strict stack bounds.

elf/tst-tls20.c

index ce4635eeb1af1dcf00241c2d0969369a947eabf4..3e94590a001bde7781d11182502fb06d85920f89 100644 (file)
@@ -342,7 +342,7 @@ do_test_invalid_dependency (bool bind_now)
            xdlclose (moddep);
        }
 
-      for (int n = 1; n <= nmods; n++)
+      for (int n = 1; n < nmods; n++)
        if (mods[n] != 0)
          unload_mod (n);
     }