public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libc/4101] New: "depth" logic in argp/argp-help.c:hol_cluster_cmp is broken
@ 2007-02-26 18:57 nisse at lysator dot liu dot se
  2007-03-15 13:34 ` [Bug libc/4101] " jakub at redhat dot com
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: nisse at lysator dot liu dot se @ 2007-02-26 18:57 UTC (permalink / raw)
  To: glibc-bugs

The comparisons at the start of hol_cluster_cmp goes the wrong way. This makes
foo --help crash when foo has a sufficiently complicated argp tree such that
some clusters are of different depth.

Unfortunately, the only test case I have handy is the development version of lsh.

Tested version: 2.3.2.ds1-22sarge5, but this part of argp seems to ve unchanged
for a very long time.

patch:

--- argp-help.c 2 Mar 2004 21:15:22 -0000       1.23
+++ argp-help.c 26 Feb 2007 17:50:38 -0000      1.24
@@ -690,9 +690,9 @@ hol_cluster_cmp (const struct hol_cluste
 {
   /* If one cluster is deeper than the other, use its ancestor at the same
      level, so that finding the common ancestor is straightforward.  */
-  while (cl1->depth < cl2->depth)
+  while (cl1->depth > cl2->depth)
     cl1 = cl1->parent;
-  while (cl2->depth < cl1->depth)
+  while (cl2->depth > cl1->depth)
     cl2 = cl2->parent;
 
   /* Now reduce both clusters to their ancestors at the point where both have

-- 
           Summary: "depth" logic in argp/argp-help.c:hol_cluster_cmp is
                    broken
           Product: glibc
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: libc
        AssignedTo: drepper at redhat dot com
        ReportedBy: nisse at lysator dot liu dot se
                CC: glibc-bugs at sources dot redhat dot com
 GCC build triplet: any
  GCC host triplet: any
GCC target triplet: any


http://sourceware.org/bugzilla/show_bug.cgi?id=4101

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-07-12 14:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-26 18:57 [Bug libc/4101] New: "depth" logic in argp/argp-help.c:hol_cluster_cmp is broken nisse at lysator dot liu dot se
2007-03-15 13:34 ` [Bug libc/4101] " jakub at redhat dot com
2007-03-15 20:12 ` drepper at redhat dot com
2007-07-12 14:59 ` cvs-commit at gcc dot gnu dot org

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).