From 5a885a9150ebac306f031f8a907543c7060a4b9e Mon Sep 17 00:00:00 2001 From: George Bosilca Date: Tue, 12 Aug 2008 16:59:27 +0000 Subject: [PATCH] Safety net for the sscanf function. Without the \0 at the end of the buffer, we can read outside the allocated memory. This commit was SVN r19258. --- opal/mca/paffinity/linux/plpa/src/libplpa/plpa_map.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opal/mca/paffinity/linux/plpa/src/libplpa/plpa_map.c b/opal/mca/paffinity/linux/plpa/src/libplpa/plpa_map.c index 46b1a655dd..052ff0dbaa 100644 --- a/opal/mca/paffinity/linux/plpa/src/libplpa/plpa_map.c +++ b/opal/mca/paffinity/linux/plpa/src/libplpa/plpa_map.c @@ -172,7 +172,7 @@ static void clear_cache(void) static void load_cache(const char *sysfs_mount) { int i, j, k, invalid_entry, fd; - char path[PATH_MAX], buf[8]; + char path[PATH_MAX], buf[8] = "\0\0\0\0\0\0\0\0"; PLPA_NAME(cpu_set_t) *cores_on_sockets; int found;