From: Ben Gras Date: Tue, 21 Jun 2005 16:18:23 +0000 (+0000) Subject: Corrected buffer size calculation from MAX(bufsize,realsize) X-Git-Tag: v3.1.0~714 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/doxygen.log?a=commitdiff_plain;h=3bb4d191d712b268b3769425461df7708a6d975f;p=minix.git Corrected buffer size calculation from MAX(bufsize,realsize) to MIN(bufsize,realsize) while copying boot params. --- diff --git a/kernel/start.c b/kernel/start.c index 21ccbfccf..06ac5fdb4 100755 --- a/kernel/start.c +++ b/kernel/start.c @@ -49,7 +49,7 @@ U16_t parmoff, parmsize; /* boot parameters offset and length */ /* Copy the boot parameters to kernel memory. */ kinfo.params_base = seg2phys(mds) + parmoff; - kinfo.params_size = MAX(parmsize,sizeof(params)-2); + kinfo.params_size = MIN(parmsize,sizeof(params)-2); phys_copy(kinfo.params_base, vir2phys(params), kinfo.params_size); /* Record miscellaneous information for user-space servers. */