Bug 3776 - lpc dumps core on *any* command
Summary: lpc dumps core on *any* command
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: lpr
Version: 6.0
Hardware: i386
OS: Linux
high
medium
Target Milestone: ---
Assignee: Bill Nottingham
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 1999-06-28 13:33 UTC by ms
Modified: 2014-03-17 02:09 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 1999-07-12 14:22:57 UTC


Attachments (Terms of Use)

Description ms 1999-06-28 13:33:50 UTC
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 14:09:59 UTC
what's your /etc/printcap look like?

Comment 2 Bill Nottingham 1999-07-08 15:06:59 UTC
I still can't reproduce this. Can you get a stack trace?

Comment 3 Bill Nottingham 1999-07-09 22:01:59 UTC
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 10:52:59 UTC
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 14:22:59 UTC
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.