|
@@ -215,15 +215,15 @@ tre_tnfa_run_parallel(const tre_tnfa_t *tnfa, const void *string,
|
|
/* Ensure that tbytes and xbytes*num_states cannot overflow, and that
|
|
/* Ensure that tbytes and xbytes*num_states cannot overflow, and that
|
|
* they don't contribute more than 1/8 of SIZE_MAX to total_bytes. */
|
|
* they don't contribute more than 1/8 of SIZE_MAX to total_bytes. */
|
|
if (num_tags > SIZE_MAX/(8 * sizeof(regoff_t) * tnfa->num_states))
|
|
if (num_tags > SIZE_MAX/(8 * sizeof(regoff_t) * tnfa->num_states))
|
|
- goto error_exit;
|
|
|
|
|
|
+ return REG_ESPACE;
|
|
|
|
|
|
/* Likewise check rbytes. */
|
|
/* Likewise check rbytes. */
|
|
if (tnfa->num_states+1 > SIZE_MAX/(8 * sizeof(*reach_next)))
|
|
if (tnfa->num_states+1 > SIZE_MAX/(8 * sizeof(*reach_next)))
|
|
- goto error_exit;
|
|
|
|
|
|
+ return REG_ESPACE;
|
|
|
|
|
|
/* Likewise check pbytes. */
|
|
/* Likewise check pbytes. */
|
|
if (tnfa->num_states > SIZE_MAX/(8 * sizeof(*reach_pos)))
|
|
if (tnfa->num_states > SIZE_MAX/(8 * sizeof(*reach_pos)))
|
|
- goto error_exit;
|
|
|
|
|
|
+ return REG_ESPACE;
|
|
|
|
|
|
/* Compute the length of the block we need. */
|
|
/* Compute the length of the block we need. */
|
|
tbytes = sizeof(*tmp_tags) * num_tags;
|
|
tbytes = sizeof(*tmp_tags) * num_tags;
|