On Thu, Oct 23, 2025 at 03:30:06PM +0200, Frank Busse wrote:
> Hi,
>
> KLEE again:
>
> ---
> $ printf '--------' | ./tr -s - ""
> ERROR: AddressSanitizer: heap-buffer-overflow
> $ printf '-' | ./tr -cs "" ""
> ERROR: AddressSanitizer: heap-buffer-overflow
> ---
>
>
> Best,
>
> Frank
>
Empty sets should not be allowed, unless -d is used I think.
(Briefly tested against GNU tr and OpenBSD tr).
At a glance, maybe this:
if (!sflag && !set2ranges && !set2check)
eprintf("cannot map to an empty set.\n");
should be:
if (!dflag && !set2ranges && !set2check)
eprintf("cannot map to an empty set.\n");
Please write a patch, it would help a lot,
--
Kind regards,
Hiltjo