bug-gnu-utils
[Top][All Lists]
Advanced

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

[PATCH] patch segfaults on illegal arguments to certain options


From: Michael Fedrowitz
Subject: [PATCH] patch segfaults on illegal arguments to certain options
Date: Wed, 3 Apr 2002 16:51:20 +0200
User-agent: Mutt/1.3.28i

 Hi,

patch segfaults when passing an illegal argument to certain options
(like --quoting-style or --version-control) on printing program_name as
part of the error message. The patch below seems to fix this, though I
have to admit I'm not entirely sure why. ;) (Maybe some subtle
difference between array and pointer initialization?)

-Michael


diff -urN patch-2.5.4.orig/common.h patch-2.5.4/common.h
--- patch-2.5.4.orig/common.h   Mon Aug 30 08:20:08 1999
+++ patch-2.5.4/common.h        Wed Apr  3 16:39:27 2002
@@ -156,7 +156,7 @@
 
 /* globals */
 
-extern char const program_name[];
+extern char const *program_name;
 
 XTERN char *buf;                       /* general purpose buffer */
 XTERN size_t bufsize;                  /* allocated size of buf */
diff -urN patch-2.5.4.orig/patch.c patch-2.5.4/patch.c
--- patch-2.5.4.orig/patch.c    Mon Aug 30 08:20:08 1999
+++ patch-2.5.4/patch.c Wed Apr  3 16:39:27 2002
@@ -107,7 +107,7 @@
 
 static char serrbuf[BUFSIZ];
 
-char const program_name[] = "patch";
+char const *program_name = "patch";
 
 /* Apply a set of diffs as appropriate. */
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]