From: Nickolai Zeldovich Date: Sun, 21 Apr 2002 04:56:31 +0000 (+0000) Subject: Make sure we have enough memory to allocate the return list. X-Git-Tag: openafs-stable-1_2_4~55 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=920a9ed93c2802c9b51535a1f33e3eb9fed82bf6;p=packages%2Fo%2Fopenafs.git Make sure we have enough memory to allocate the return list. (cherry picked from commit ec04dd0090b69f3cd39c93498da6175b2eb1a842) --- diff --git a/src/ptserver/ptprocs.c b/src/ptserver/ptprocs.c index a102910e2..faa0864dd 100644 --- a/src/ptserver/ptprocs.c +++ b/src/ptserver/ptprocs.c @@ -527,6 +527,7 @@ afs_int32 idToName (call, aid, aname) if (size <= 0) size = 0; aname->namelist_val = (prname *)malloc(size*PR_MAXNAMELEN); aname->namelist_len = 0; + if (aname->namelist_val == 0) return PRNOMEM; if (aid->idlist_len == 0) return 0; if (size == 0) return PRTOOMANY; /* rxgen will probably handle this */