From: Przemek Klosowski <przemek@rrdjazz.nist.gov>
Subject: Re: lpd memory violations
Date: Mon, 2 Dec 1996 10:48:04 -0500 [thread overview]
Message-ID: <2ff7acbb903ae8e33fa7117cf8763463.axp-list@archive.invalid> (raw)
Since several people told me that they haven't received my report
on lpr segfaults, so here is a copy.
Problem report with RH4.0: lpr
I upgraded to 4.0 from 3.0.3 and then installed the RPMs from
/pub/redhat/redhat-4.0/updates/axp, including lpr-0.12-1.axp.rpm
'lpr' dumps core when presented with unknown printer
# lpr -Pnosuchprinter
Segmentation fault
It looks like it is due to a questionable code in lpr.c:
fatal("%s: unknown printer", s);
where 'fatal()' is defined as follows:
fatal(msg, a1, a2, a3)
char *msg;
{
printf("%s: ", name);
printf(msg, a1, a2, a3);
putchar('\n');
exit(1);
}
The pointers are implicitly declared as integers, and are truncated.
The proper solution is to define fatal() using varargs; a simple
patch is to declare a1 a2 a3 as void *:
fatal(msg, a1, a2, a3)
char *msg;
+ void *a1, *a2, *a3;
{
There are 3 places where such unsavory practices take place in lpr-0.12-1:
common_source/common.c:338:/*VARARGS1*/
lpd/printjob.c:1291:/*VARARGS1*/
lpr/lpr.c:751:/*VARARGS1*/
przemek klosowski <przemek@nist.gov> (301) 975-6249
Reactor Division (bldg. 235), E111
National Institute of Standards and Technology
Gaithersburg, MD 20899, USA
--
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject. Do not send it to axp-list@redhat.com
next reply other threads:[~1996-12-02 15:48 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
1996-12-02 15:48 Przemek Klosowski [this message]
-- strict thread matches above, loose matches on Subject: below --
1996-12-02 4:28 lpd memory violations Przemek Klosowski
[not found] <Pine.LNX.3.95.961130190432.5883B-100000@wehsal.mb.jhu.edu>
1996-12-01 22:22 ` Michal Jaegermann
1996-12-02 3:51 ` Jeff Odom
1996-12-01 0:12 Jeff Odom
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox