Blame SOURCES/github_6b93714b_cmdline.patch

608733
commit 6b93714b83d59ae4147b8ec3887261aca7fd6f65
608733
Author: Dave Anderson <anderson@redhat.com>
608733
Date:   Mon Jan 7 10:44:29 2019 -0500
608733
608733
    Prevent a SIGSEGV if a user attempts to input a command line that
608733
    exceeds the maximum length of 1500 bytes.  The patch displays an
608733
    error message and ignores the command line.
608733
    (anderson@redhat.com)
608733
608733
diff --git a/cmdline.c b/cmdline.c
608733
index 665f48c..796f7c5 100644
608733
--- a/cmdline.c
608733
+++ b/cmdline.c
608733
@@ -1,8 +1,8 @@
608733
 /* cmdline.c - core analysis suite
608733
  *
608733
  * Copyright (C) 1999, 2000, 2001, 2002 Mission Critical Linux, Inc.
608733
- * Copyright (C) 2002-2015,2018 David Anderson
608733
- * Copyright (C) 2002-2015,2018 Red Hat, Inc. All rights reserved.
608733
+ * Copyright (C) 2002-2015,2019 David Anderson
608733
+ * Copyright (C) 2002-2015,2019 Red Hat, Inc. All rights reserved.
608733
  *
608733
  * This program is free software; you can redistribute it and/or modify
608733
  * it under the terms of the GNU General Public License as published by
608733
@@ -121,9 +121,11 @@ process_command_line(void)
608733
 			args[0] = NULL;
608733
 			fprintf(fp, "\n");
608733
 			return;
608733
-		} 
608733
-
608733
-		strcpy(pc->command_line, pc->readline);
608733
+		}
608733
+		if (strlen(pc->readline) >= BUFSIZE)
608733
+			error(FATAL, "input line exceeds maximum of 1500 bytes\n");	
608733
+		else	
608733
+			strcpy(pc->command_line, pc->readline);
608733
 		free(pc->readline); 
608733
 
608733
 		clean_line(pc->command_line);