string-util: check for overflow in strrep()
This simply mirrors the same overflow check we already have in strrepa(), in case someone passed us a sufficiently long string. strrep() is currently used only in tests, so this is just hardening.
This commit is contained in:
@@ -325,6 +325,8 @@ TEST(strrep) {
|
||||
|
||||
ASSERT_STREQ(onea, "waldo");
|
||||
ASSERT_STREQ(threea, "waldowaldowaldo");
|
||||
|
||||
ASSERT_NULL(strrep("waldo", SIZE_MAX - 1));
|
||||
}
|
||||
|
||||
TEST(string_has_cc) {
|
||||
|
||||
Reference in New Issue
Block a user