From 9819bf5df01f7ad08b08fdffb2d26e804977c831 Mon Sep 17 00:00:00 2001 From: John Johansen Date: Thu, 3 Mar 2011 15:53:23 -0800 Subject: [PATCH] Ensure that the buffer read from /proc/sys/kernel/osrelease is null terminated Signed-off-by: Jamie Strandboge Acked-by: John Johansen --- parser/parser_misc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/parser/parser_misc.c b/parser/parser_misc.c index e8689b6bc..44f4e07ff 100644 --- a/parser/parser_misc.c +++ b/parser/parser_misc.c @@ -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;