summaryrefslogtreecommitdiffstats
path: root/usr.sbin
diff options
context:
space:
mode:
authordwmalone <dwmalone@FreeBSD.org>2001-02-25 13:50:29 +0000
committerdwmalone <dwmalone@FreeBSD.org>2001-02-25 13:50:29 +0000
commit69c64365e594d4895efab2beaf9a1c9d32081733 (patch)
treeaef6ae7bd3232dc841d4c7a6bc7a19bfb27e120b /usr.sbin
parent1ab8876e4a42580709467c199840ab353252d7bd (diff)
downloadFreeBSD-src-69c64365e594d4895efab2beaf9a1c9d32081733.zip
FreeBSD-src-69c64365e594d4895efab2beaf9a1c9d32081733.tar.gz
Stop pac dereferencing a null pointer if accounting is not enabeled.
PR: 24798 18191 Submitted by: Nick Hilliard <nick@netability.ie> Reviewed by: gad
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/lpr/pac/pac.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/usr.sbin/lpr/pac/pac.c b/usr.sbin/lpr/pac/pac.c
index 08de114..d68e625 100644
--- a/usr.sbin/lpr/pac/pac.c
+++ b/usr.sbin/lpr/pac/pac.c
@@ -450,7 +450,8 @@ chkprinter(s)
case PCAPERR_TCLOOP:
fatal(pp, "%s", pcaperr(stat));
}
- acctfile = pp->acct_file;
+ if ((acctfile = pp->acct_file) == NULL)
+ errx(3, "accounting not enabled for printer %s", s);
if (!pflag && pp->price100)
price = pp->price100/10000.0;
sumfile = (char *) calloc(sizeof(char), strlen(acctfile)+5);
OpenPOWER on IntegriCloud