On Sun, Jul 3, 2011 at 10:11 PM, Nicholas Marriott
<[email protected]> wrote:
> From NetBSD with overflow check and a couple of minor tweaks by me.
>
> libc minor bump.
>
> Needed for libedit with wide characters which might be nice sometime.
>
> Comments/ok?
ok matthew@
> + len = wcslen(str) + 1;
> + if (SIZE_MAX / sizeof (wchar_t) < len) {
> + errno = ENOMEM;
> + return (NULL);
> + }
Is this check actually necessary? How do you get a wide char string
whose length exceeds the total address space?