diff options
author | Olaf Hering <olaf@aepfle.de> | 2012-12-13 16:48:47 +0100 |
---|---|---|
committer | Simon Horman <horms@verge.net.au> | 2012-12-14 22:31:03 +0900 |
commit | d5efc524567d675759c82aa7bbb94bab8fd678f8 (patch) | |
tree | c48a2afeb0f4f874748dc31b0ab727fa19b44f7c | |
parent | c0099a82f1b38cf5d0c80e046e3a92d8d585133e (diff) | |
download | kexec-tools-d5efc524567d675759c82aa7bbb94bab8fd678f8.tar.gz |
fixed strncat size argument on ppc64
Signed-off-by: Olaf Hering <olaf@aepfle.de>
Signed-off-by: Simon Horman <horms@verge.net.au>
-rw-r--r-- | kexec/arch/ppc64/fs2dt.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/kexec/arch/ppc64/fs2dt.c b/kexec/arch/ppc64/fs2dt.c index d2b6b185..f02540d1 100644 --- a/kexec/arch/ppc64/fs2dt.c +++ b/kexec/arch/ppc64/fs2dt.c @@ -499,7 +499,7 @@ static void putnode(void) basename = strrchr(pathname,'/'); - strcat(pathname, "/"); + strncat(pathname, "/", MAXPATH - strlen(pathname) - 1); dn = pathname + strlen(pathname); putprops(dn, namelist, numlist); @@ -560,7 +560,7 @@ static void putnode(void) char *old_param; strcpy(filename, pathname); - strcat(filename, "bootargs"); + strncat(filename, "bootargs", MAXPATH - strlen(filename) - 1); fp = fopen(filename, "r"); if (fp) { if (getline(&last_cmdline, &cmd_len, fp) == -1) @@ -599,7 +599,7 @@ static void putnode(void) * pseries/hvcterminal is supported. */ strcpy(filename, pathname); - strncat(filename, "linux,stdout-path", MAXPATH); + strncat(filename, "linux,stdout-path", MAXPATH - strlen(filename) - 1); fd = open(filename, O_RDONLY); if (fd == -1) { printf("Unable to find %s, printing from purgatory is diabled\n", @@ -623,8 +623,8 @@ static void putnode(void) read(fd, buff, statbuf.st_size); close(fd); strncpy(filename, "/proc/device-tree/", MAXPATH); - strncat(filename, buff, MAXPATH); - strncat(filename, "/compatible", MAXPATH); + strncat(filename, buff, MAXPATH - strlen(filename) - 1); + strncat(filename, "/compatible", MAXPATH - strlen(filename) - 1); fd = open(filename, O_RDONLY); if (fd == -1) { printf("Unable to find %s printing from purgatory is diabled\n", |