1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-10-18 02:19:39 +00:00

sort: Fix random sort

bwsrawdata() is supposed to return the string buffer.

PR:		259451
Reported by:	sigsys@gmail.com
Fixes:		d053fb22f6 ("usr.bin/sort: Avoid UBSan errors")
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit e9bfb50d5e)
This commit is contained in:
Mark Johnston 2021-10-29 14:25:42 -04:00
parent a2ca269b38
commit 946a297fbd

View File

@ -152,7 +152,7 @@ bwsprintf(FILE *f, struct bwstring *bws, const char *prefix, const char *suffix)
const void* bwsrawdata(const struct bwstring *bws)
{
return (&(bws->wdata));
return (bws->wdata.str);
}
size_t bwsrawlen(const struct bwstring *bws)