[OpenAFS-devel] Re: [OpenAFS] OpenAFS server on SuSE 8.2

Vladimir Nadvornik nadvornik@suse.cz
Wed, 10 Sep 2003 10:20:58 +0200


--Boundary-00=_q7tX//BP29v6qDy
Content-Type: text/plain;
  charset="us-ascii"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Hi,

I checked kaserver with valgrind and have found that there were writes behind
the end of an allocated buffer. The attached patch fixes it.
Jan Hrabe confirmed that the patch fixed his problem.

-- 
Vladimir Nadvornik
developer
---------------------------------------------------------------------  
SuSE CR, s.r.o.                             e-mail: nadvornik@suse.cz
Drahobejlova 27                             tel:+420 2 9654 2373 
190 00 Praha 9                              fax:+420 2 9654 2374   
Ceska republika                             http://www.suse.cz    

--Boundary-00=_q7tX//BP29v6qDy
Content-Type: text/x-diff;
  charset="us-ascii";
  name="openafs-1.2.10-malloc.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
	filename="openafs-1.2.10-malloc.patch"

--- src/lwp/lwp.c
+++ src/lwp/lwp.c
@@ -327,7 +327,7 @@
 	}
 	stackptr -= stacksize;
 #else
-	if ((stackptr = (char *) malloc(stacksize)) == NULL) {
+	if ((stackptr = (char *) malloc(stacksize + 8)) == NULL) {
 	    Set_LWP_RC();
 	    return LWP_ENOMEM;
 	}

--Boundary-00=_q7tX//BP29v6qDy--