]> git.ipfire.org Git - thirdparty/systemd.git/commit
string-util: check for overflow in strrep()
authorFrantisek Sumsal <frantisek@sumsal.cz>
Thu, 16 Apr 2026 09:59:36 +0000 (11:59 +0200)
committerLuca Boccassi <luca.boccassi@gmail.com>
Fri, 22 May 2026 12:32:04 +0000 (13:32 +0100)
commitd8f2a2fb92cbc291373ca94daeee2df399f8086b
tree92eed3e5177611f1148496d1f8d610c13fcc6d6f
parent6e6aa47f468b7c4f70350d4498553c8ae5967335
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.

(cherry picked from commit b22daa97e1608d865ce76ed72fd6b7bd59ccbf70)
src/basic/string-util.c
src/basic/string-util.h
src/test/test-string-util.c