+ getdelaysc-fix-overrun.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     getdelays.c: fix overrun
has been added to the -mm tree.  Its filename is
     getdelaysc-fix-overrun.patch

*** Remember to use Documentation/SubmitChecklist when testing your code ***

See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find
out what to do about this

------------------------------------------------------
Subject: getdelays.c: fix overrun
From: Scott Wiersdorf <scott@xxxxxxxxxxxx>

A patch for getdelays.c that fixes a buffer overrun when you set -w.

Cc: <matt@xxxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 Documentation/accounting/getdelays.c |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff -puN Documentation/accounting/getdelays.c~getdelaysc-fix-overrun Documentation/accounting/getdelays.c
--- a/Documentation/accounting/getdelays.c~getdelaysc-fix-overrun
+++ a/Documentation/accounting/getdelays.c
@@ -61,8 +61,6 @@ __u64 stime, utime;
 #define MAX_MSG_SIZE	1024
 /* Maximum number of cpus expected to be specified in a cpumask */
 #define MAX_CPUS	32
-/* Maximum length of pathname to log file */
-#define MAX_FILENAME	256
 
 struct msgtemplate {
 	struct nlmsghdr n;
@@ -231,7 +229,7 @@ int main(int argc, char *argv[])
 	int count = 0;
 	int write_file = 0;
 	int maskset = 0;
-	char logfile[128];
+	char *logfile = NULL;
 	int loop = 0;
 
 	struct msgtemplate msg;
@@ -251,7 +249,7 @@ int main(int argc, char *argv[])
 			print_io_accounting = 1;
 			break;
 		case 'w':
-			strncpy(logfile, optarg, MAX_FILENAME);
+			logfile = strdup(optarg);
 			printf("write to file %s\n", logfile);
 			write_file = 1;
 			break;
_

Patches currently in -mm which might be from scott@xxxxxxxxxxxx are

getdelaysc-fix-overrun.patch

-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux