From f95ac73519645b0a2285aa34600030541879c211 Mon Sep 17 00:00:00 2001 From: Bruce Evans Date: Tue, 16 Jun 1998 14:36:40 +0000 Subject: [PATCH] Use copyout() instead of bcopy() to copy the image to user space. bcopy() caused panics under heavy paging (not quite as suspected - the kernel stack seemed to get corrupted). Fixed long lines. Reviewed by: phk --- sys/kern/imgact_gzip.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/sys/kern/imgact_gzip.c b/sys/kern/imgact_gzip.c index aabbdc9fb697..3c9b6a47b709 100644 --- a/sys/kern/imgact_gzip.c +++ b/sys/kern/imgact_gzip.c @@ -6,7 +6,7 @@ * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp * ---------------------------------------------------------------------------- * - * $Id: imgact_gzip.c,v 1.31 1997/09/02 20:05:34 bde Exp $ + * $Id: imgact_gzip.c,v 1.32 1997/12/14 19:36:24 jdp Exp $ * * This module handles execution of a.out files which have been run through * "gzip". This saves diskspace, but wastes cpu-cycles and VM. @@ -341,12 +341,13 @@ Flush(void *vp, u_char * ptr, u_long siz) } if (gz->file_offset == 0) { q = (u_char *) gz->virtual_offset; - bcopy(&gz->a_out, q, sizeof gz->a_out); + copyout(&gz->a_out, q, sizeof gz->a_out); } } } /* Skip over zero-padded first PAGE if needed */ - if (gz->output < gz->file_offset && (gz->output + siz) > gz->file_offset) { + if (gz->output < gz->file_offset && + gz->output + siz > gz->file_offset) { i = min(siz, gz->file_offset - gz->output); gz->output += i; p += i; @@ -354,8 +355,9 @@ Flush(void *vp, u_char * ptr, u_long siz) } if (gz->output >= gz->file_offset && gz->output < gz->file_end) { i = min(siz, gz->file_end - gz->output); - q = (u_char *) gz->virtual_offset + gz->output - gz->file_offset; - bcopy(p, q, i); + q = (u_char *) gz->virtual_offset + + gz->output - gz->file_offset; + copyout(p, q, i); gz->output += i; p += i; siz -= i;