Re: [PATCH] posix: Remove unnecessary overflow check in wordexp (BZ 34090)
Andreas Schwab <[email protected]>
| Newsgroups | gmane.comp.lib.glibc.alpha |
|---|---|
| Message-ID | <[email protected]> |
On Aug 13 2026, Adhemerval Zanella wrote:
> @@ -2269,16 +2268,14 @@ wordexp (const char *words, wordexp_t *pwordexp, int flags)
> {
> /* WRDE_APPEND with an existing word list: duplicate the array so that
> realloc during parsing does not invalidate the caller's pointer. The
> - strings themselves are shared. */
> - size_t num_p;
> - char **dup;
> - if (INT_ADD_WRAPV (pwordexp->we_offs, pwordexp->we_wordc, &num_p)
> - || INT_ADD_WRAPV (num_p, 1, &num_p))
> - return WRDE_NOSPACE;
> - dup = __libc_reallocarray (NULL, num_p, sizeof *dup);
> + strings themselves are shared an the array already holds
and
--
Andreas Schwab, SUSE Labs, [email protected]
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."