Bug 3776 - lpc dumps core on *any* command
lpc dumps core on *any* command
Status: CLOSED NEXTRELEASE
Product: Red Hat Linux
Classification: Retired
Component: lpr (Show other bugs)
6.0
i386 Linux
high Severity medium
: ---
: ---
Assigned To: Bill Nottingham
: Security
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 1999-06-28 09:33 EDT by ms
Modified: 2014-03-16 22:09 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 1999-07-12 10:22:57 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description ms 1999-06-28 09:33:50 EDT
If you enter any command in "lpc" e.g.

[root@research /root]# lpc
lpc> status

lpc will dump core

[root@research /root]# rpm -qf `which lpc`
lpr-0.35-1
Comment 1 Bill Nottingham 1999-06-28 10:09:59 EDT
what's your /etc/printcap look like?
Comment 2 Bill Nottingham 1999-07-08 11:06:59 EDT
I still can't reproduce this. Can you get a stack trace?
Comment 3 Bill Nottingham 1999-07-09 18:01:59 EDT
ack, could you try the debug version at:
http://charlotte.redhat.com/~notting/ftp/lpr/lpr-0.35-1debug.i386.rpm,
and get a stack trace from that?
Comment 4 ms 1999-07-12 06:52:59 EDT
Fixed here:

--- lpc.c.orig  Mon Jul 12 10:52:42 1999
+++ lpc.c       Mon Jul 12 12:39:27 1999
@@ -180,7 +180,9 @@
 {
        register char *cp;
        register char **argp = margv;
-       int n;
+       /* the compiler doesn't initialize n, so it's value is bogus
+           and the for loop terminates without doing anything */
+       int n = 0;

        margc = 0;
        for (cp = cmdline; *cp && (cp - cmdline) < sizeof(cmdline) &&
n < 20; n++) {
Comment 5 Bill Nottingham 1999-07-12 10:22:59 EDT
Thanks for the patch & tracking this down. It's rather obvious
in hindsight. Fixed in lpr-0.38-2.

Note You need to log in before you can comment on or make changes to this bug.