aboutsummaryrefslogtreecommitdiff
path: root/lib/std/os/linux
diff options
context:
space:
mode:
authorjumpnbrownweasel <49791153+jumpnbrownweasel@users.noreply.github.com>2021-04-25 16:16:24 -0700
committerGitHub <noreply@github.com>2021-04-25 19:16:24 -0400
commitbf67a3fdc9efea7126058b21e687c24868bc1268 (patch)
treeb1f5f2d6be676d0435024d464b3af7facdd617c3 /lib/std/os/linux
parentc420eb60ad17599f035594ba877df66b7705fb25 (diff)
downloadzig-bf67a3fdc9efea7126058b21e687c24868bc1268.tar.gz
zig-bf67a3fdc9efea7126058b21e687c24868bc1268.zip
#8454 Fix for std.mem.replacementSize adjacent matches bug. (#8455)
* #8454 Fix for std.mem.replacementSize adjacent matches bug. When two 'needle' values are adjacent in the 'input' slice, the size is not counted correctly. The 2nd 'needle' value is not matched because the index is incremented by one after changing the index to account for the first value. The impact is the the size returned is incorrect, and could cause UB when this amount is used to size of the buffer passed to std.mem.replace. * Apply changes from PR review: - Add assert checking that the needle is non-empty and doc for this. - Add minimal test that an empty input works. - Use testing.expectEqualStrings.
Diffstat (limited to 'lib/std/os/linux')
0 files changed, 0 insertions, 0 deletions