mirror of
https://github.com/morgan9e/systemd
synced 2026-04-15 08:56:15 +09:00
fileio: fix MIN/MAX mixup (#3896)
The intention is to clamp the value to READ_FULL_BYTES_MAX, which would be the minimum of the two.
This commit is contained in:
committed by
Zbigniew Jędrzejewski-Szmek
parent
2604646c05
commit
82b103a7ce
@@ -271,7 +271,7 @@ int read_full_stream(FILE *f, char **contents, size_t *size) {
|
||||
if (n >= READ_FULL_BYTES_MAX)
|
||||
return -E2BIG;
|
||||
|
||||
n = MAX(n * 2, READ_FULL_BYTES_MAX);
|
||||
n = MIN(n * 2, READ_FULL_BYTES_MAX);
|
||||
}
|
||||
|
||||
buf[l] = 0;
|
||||
|
||||
Reference in New Issue
Block a user