mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2025-12-24 21:40:05 +01:00
util: avoid potential integer overflow
If we need more than 1000 pairs, we have a problem... Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
7ad3dcf939
commit
ba922b59ef
1 changed files with 2 additions and 0 deletions
|
|
@ -565,6 +565,8 @@ strv_join(char **strv, const char *joiner)
|
|||
slen += strlen(*s);
|
||||
}
|
||||
|
||||
assert(slen < 1000);
|
||||
|
||||
slen += (count - 1) * strlen(joiner);
|
||||
|
||||
str = zalloc(slen + 1); /* trailing \0 */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue