aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHiroyuki Chishiro <chishiro@cs.unc.edu>2013-07-02 03:03:05 -0400
committerBjoern Brandenburg <bbb@mpi-sws.org>2013-07-02 03:03:05 -0400
commit5e1cee01ba46cffef72bae9c98d025a1c6cf7011 (patch)
treebeeb9bd11f87b8be58667f05b5ae85d440109e1d
parentfcf492f8e1c7ef975e0d20cb50826ddacd33b884 (diff)
User large enough buffer to read /proc/litmus/release_masterpgm
The string 'NO_CPU' needs to fit into the buffer.
-rw-r--r--src/migration.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/migration.c b/src/migration.c
index 152d81b..5de81d5 100644
--- a/src/migration.c
+++ b/src/migration.c
@@ -11,7 +11,7 @@ extern ssize_t read_file(const char* fname, void* buf, size_t maxlen);
11int release_master() 11int release_master()
12{ 12{
13 static const char NO_CPU[] = "NO_CPU"; 13 static const char NO_CPU[] = "NO_CPU";
14 char buf[5] = {0}; /* up to 9999 CPUs */ 14 char buf[7] = {0}; /* up to 999999 CPUs */
15 int master = -1; 15 int master = -1;
16 16
17 int ret = read_file("/proc/litmus/release_master", &buf, sizeof(buf)-1); 17 int ret = read_file("/proc/litmus/release_master", &buf, sizeof(buf)-1);