Print this page
11472 fix libdemangle rust changes

*** 237,247 **** return (B_FALSE); } rem = sv_remaining(&sv); ! if (rem < len || len == SIZE_MAX) { st->rds_error = EINVAL; return (B_FALSE); } /* Is this the last segment before the terminating E? */ --- 237,247 ---- return (B_FALSE); } rem = sv_remaining(&sv); ! if (rem < len) { st->rds_error = EINVAL; return (B_FALSE); } /* Is this the last segment before the terminating E? */
*** 382,398 **** sv_init_sv(svp, &sv); return (B_TRUE); } /* ! * A 10 digit value would imply a name 1Gb or larger in size. It seems ! * unlikely to the point of absurdity any such value could every possibly ! * be valid (or even have compiled properly). This also prevents the ! * uint64_t conversion from possibly overflowing since the value must always ! * be below 10 * UINT32_MAX. */ ! #define MAX_DIGITS 10 static boolean_t rustdem_parse_num(rustdem_state_t *restrict st, strview_t *restrict svp, uint64_t *restrict valp) { --- 382,396 ---- sv_init_sv(svp, &sv); return (B_TRUE); } /* ! * We have to pick an arbitrary limit here; 999,999,999 fits comfortably ! * within an int32_t, so let's go with that, as it seems unlikely we'd ! * ever see a larger value in context. */ ! #define MAX_DIGITS 9 static boolean_t rustdem_parse_num(rustdem_state_t *restrict st, strview_t *restrict svp, uint64_t *restrict valp) {