mirror of
https://gitlab.com/apparmor/apparmor
synced 2025-08-29 05:17:59 +00:00
Ensure that the buffer read from /proc/sys/kernel/osrelease is null terminated
Signed-off-by: Jamie Strandboge <jamie@canonical.com> Acked-by: John Johansen <john.johansen@canonical.com>
This commit is contained in:
parent
174c89f772
commit
9819bf5df0
@ -237,6 +237,7 @@ static size_t kernel_af_max(void) {
|
||||
close(fd);
|
||||
if (!res)
|
||||
return 0;
|
||||
buffer[sizeof(buffer)-1] = '\0';
|
||||
res = sscanf(buffer, "2.6.%d", &major);
|
||||
if (res != 1)
|
||||
return 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user