mirror of
https://github.com/Dasharo/systemd.git
synced 2026-03-06 15:02:31 -08:00
terminal-util: add paranoid overflow check
This commit is contained in:
@@ -1041,6 +1041,10 @@ int ptsname_malloc(int fd, char **ret) {
|
||||
}
|
||||
|
||||
free(c);
|
||||
|
||||
if (l > SIZE_MAX / 2)
|
||||
return -ENOMEM;
|
||||
|
||||
l *= 2;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user