Linux PARISC architecture development
 help / color / mirror / Atom feed
* [parisc-linux] Bug in more
@ 2001-01-11 22:09 Richard Hirst
  0 siblings, 0 replies; only message in thread
From: Richard Hirst @ 2001-01-11 22:09 UTC (permalink / raw)
  To: Andries Brouwer; +Cc: parisc-linux, util-linux

Hi,
  I have found a bug in 'more', util-linux-2.10r source.
At startup tailequ() is called to match the last component of argv[0]
against "page".  tailequ() is broken because it accesses one location
below the start of argv[0].  This causes a crash on parisc, where the
stack grows upwards and argv[0] is the first element on the stack.

Richard

--- util-linux-2.10r/text-utils/more.c-	Thu Jan 11 15:00:59 2001
+++ util-linux-2.10r/text-utils/more.c	Thu Jan 11 15:02:52 2001
@@ -815,8 +815,8 @@
 	register char *tail;
 
 	tail = path + strlen(path);
-	while (tail >= path)
-		if (*(--tail) == '/')
+	while (--tail >= path)
+		if (*tail == '/')
 			break;
 	++tail;
 	while (*tail++ == *string++)

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2001-01-11 22:14 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-01-11 22:09 [parisc-linux] Bug in more Richard Hirst

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox