+ if (filesize != 0)
+ {
+ /* Put an upper bound based on a file full of single char keys.
+ This is to prevent fuzzed binary silliness. It is easily
+ possible to set up loops over file blocks that add syms
+ without end. */
+ if (filesize / (sizeof (struct vms_rfa) + 2) <= -1u)
+ csm.limit = filesize / (sizeof (struct vms_rfa) + 2);
+ }
+ if (csm.max > csm.limit)
+ csm.max = csm.limit;
+ if (_bfd_mul_overflow (csm.max, sizeof (struct carsym), &amt))
+ return NULL;
+ csm.idx = csbuf = bfd_alloc (abfd, amt);
+ if (csm.idx == NULL)
+ return NULL;