From a4e1fd4b213214f564b460ad1922c6fd3abbb9bb Mon Sep 17 00:00:00 2001 From: Jaganath Kanakkassery Date: Fri, 4 Jan 2013 11:12:28 +0530 Subject: [PATCH] rfkill: Fix count parameter in read Since g_str_has_prefix() has been used with the output buffer of read it should be nul terminated --- src/rfkill.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rfkill.c b/src/rfkill.c index 6f040c9a7..70588c0a6 100644 --- a/src/rfkill.c +++ b/src/rfkill.c @@ -113,7 +113,7 @@ static gboolean rfkill_event(GIOChannel *chan, memset(sysname, 0, sizeof(sysname)); - if (read(fd, sysname, sizeof(sysname)) < 4) { + if (read(fd, sysname, sizeof(sysname) - 1) < 4) { close(fd); return TRUE; } -- 2.47.3