diff options
author | jkh <jkh@FreeBSD.org> | 1995-10-05 22:41:02 +0000 |
---|---|---|
committer | jkh <jkh@FreeBSD.org> | 1995-10-05 22:41:02 +0000 |
commit | 721965d1d6c76b28193a75f025cad53a86c01013 (patch) | |
tree | 0eabeff8a01528a720ed935fe2e8ab1cd8716817 | |
parent | 4eb877ffe481a85a067d6f4681b865ea277600b1 (diff) | |
download | FreeBSD-src-721965d1d6c76b28193a75f025cad53a86c01013.zip FreeBSD-src-721965d1d6c76b28193a75f025cad53a86c01013.tar.gz |
Fix a longstanding bug in `lpr -r'. I used alloca() instead of
malloc(), but the change is fundamentally Chris's.
Submitted by: Chris Stenton <jacs@gnome.co.uk>
-rw-r--r-- | usr.sbin/lpr/lpr/lpr.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/usr.sbin/lpr/lpr/lpr.c b/usr.sbin/lpr/lpr/lpr.c index bddf8ee..d1f0d8e 100644 --- a/usr.sbin/lpr/lpr/lpr.c +++ b/usr.sbin/lpr/lpr/lpr.c @@ -600,6 +600,7 @@ test(file) if (cp == file) { fd = checkwriteperm(file,"/"); } else { + path = alloca(strlen(file) + 1); strcpy(path,file); *cp = '\0'; fd = checkwriteperm(path,file); |