if (rep.num_catalogues && rep.num_catalogues <= SIZE_T_MAX/sizeof(char *) && rep.length <= ((SIZE_T_MAX+SIZEOF(fsListCataloguesReply)+1)>>2)) {
if (rep.num_catalogues && rep.num_catalogues <= SIZE_MAX/sizeof(char *) && rep.length <= (SIZE_MAX>>2)) {
FSListCatalogues(svr, pattern, maxNames, actualCount)    FSServer   *svr;    char       *pattern;    int         maxNames;    int        *actualCount;{    long        nbytes;    int         i,                length;    char      **clist;    char       *c;    fsListCataloguesReply rep;    fsListCataloguesReq *req;    long        rlen;    GetReq(ListCatalogues, req);    req->maxNames = maxNames;    nbytes = req->nbytes = pattern ? strlen(pattern) : 0;    req->length += (nbytes + 3) >> 2;    _FSSend(svr, pattern, nbytes);    if (!_FSReply(svr, (fsReply *) & rep,     (SIZEOF(fsListCataloguesReply) - SIZEOF(fsGenericReply)) >> 2, fsFalse))	return (char **) 0;    if (rep.num_catalogues && rep.num_catalogues <= SIZE_T_MAX/sizeof(char *)	&& rep.length <= ((SIZE_T_MAX+SIZEOF(fsListCataloguesReply)+1)>>2)) {	clist = (char **)	    FSmalloc((unsigned) rep.num_catalogues * sizeof(char *));	rlen = (rep.length << 2) - SIZEOF(fsListCataloguesReply);	c = (char *) FSmalloc((unsigned) (rlen + 1));	if ((!clist) || (!c)) {	    if (clist)		FSfree((char *) clist);	    if (c)		FSFree(c);	    _FSEatData(svr, (unsigned long) rlen);	    SyncHandle();	    return (char **) NULL;	}	_FSReadPad(svr, c, rlen);	/* unpack */	length = *c;	for (i = 0; i < rep.num_catalogues; i++) {	    clist[i] = c + 1;	    c += length + 1;	    length = *c;	    *c = '\0';	}    } else {	clist = (char **) NULL;    }    *actualCount = rep.num_catalogues;    SyncHandle();    return clist;}