if (rep.num_catalogues && rep.num_catalogues <= SIZE_T_MAX/sizeof(char *) && rep.length <= ((SIZE_T_MAX + SIZEOF(fsGetCataloguesReply) - 1)>>2)) {
if (rep.num_catalogues && rep.num_catalogues <= SIZE_MAX/sizeof(char *) && rep.length <= (SIZE_MAX >> 2)) {
FSGetCatalogues(svr, num)    FSServer   *svr;    int        *num;{    fsGetCataloguesReply rep;    char      **list;    char       *c;    int         i,                length;    fsReq      *req;    long        rlen;    GetEmptyReq(GetCatalogues, req);    if (!_FSReply(svr, (fsReply *) & rep, 0, fsFalse)) {	SyncHandle();	return (char **) NULL;    }    if (rep.num_catalogues && rep.num_catalogues <= SIZE_T_MAX/sizeof(char *)	&& rep.length <= ((SIZE_T_MAX + SIZEOF(fsGetCataloguesReply) - 1)>>2)) {	list = (char **)	       FSmalloc((unsigned) (rep.num_catalogues * sizeof(char *)));	rlen = (rep.length << 2) - SIZEOF(fsGetCataloguesReply);	c = (char *) FSmalloc((unsigned) rlen + 1);	if ((!list) || (!c)) {	    if (list)		FSfree((char *) list);	    if (c)		FSfree(c);	    _FSEatData(svr, (unsigned long) rlen);	    SyncHandle();	    return (char **) NULL;	}	_FSReadPad(svr, c, rlen);	/*	 * unpack the strings	 */	length = *c;	for (i = 0; i < (int)rep.num_catalogues; i++) {	    list[i] = c + 1;	/* skip length */	    c += length + 1;	/* find next length */	    length = *c;	    *c = '\0';		/* change length to NULL */	}    } else {	list = (char **) NULL;    }    SyncHandle();    *num = rep.num_catalogues;    return list;}