Use snprintf when constructing file paths to avoid possible buffer overflow. Change-Id: I4781d28b6f66a758d45e9ce2b3dc6ddfde0c27e1