From 159ead3b6cf0f10b178306ad766f7252c2b53ded Mon Sep 17 00:00:00 2001 From: Brian Feldman Date: Sat, 15 Jul 2000 06:35:25 +0000 Subject: Strategically change a couple malloc() calls to calloc() calls so that every request doesn't return NFSERR_STALE. This CFS bug brought to light by the letters p, h, and k :) --- security/cfs/files/patch-af | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 security/cfs/files/patch-af (limited to 'security/cfs') diff --git a/security/cfs/files/patch-af b/security/cfs/files/patch-af new file mode 100644 index 000000000000..c9d3edc2d1da --- /dev/null +++ b/security/cfs/files/patch-af @@ -0,0 +1,20 @@ +--- cfs_fh.c.orig Sat Jul 15 01:26:30 2000 ++++ cfs_fh.c Sat Jul 15 01:24:02 2000 +@@ -908,7 +908,7 @@ + f->name=NULL; + } + } else { +- if ((f=(cfs_fileid *)malloc(sizeof(cfs_fileid)))==NULL) { ++ if ((f=(cfs_fileid *)calloc(1, sizeof(cfs_fileid)))==NULL) { + fprintf(stderr,"cfsd: out of memory\n"); + cfserrno=NFSERR_STALE; /* bad news */ + return -2; +@@ -1198,7 +1198,7 @@ + #endif /* SHORTLINKS */ + )) == NULL) { + if ((f=(cfs_fileid *) +- malloc(sizeof(cfs_fileid)))==NULL) { ++ calloc(1, sizeof(cfs_fileid)))==NULL) { + fprintf(stderr,"cfsd: no memory\n"); + cfserrno=NFSERR_STALE; /* bad news */ + return -2; -- cgit v1.2.3