Calling windres without parameter was crashing (segmentation
violation). We properly check the number of argument, if none
the usage string is displayed.
---
binutils/ChangeLog | 7 +++++++
binutils/windres.c | 2 +-
2 files changed, 8 insertions(+), 1 deletions(-)
diff --git binutils/ChangeLog binutils/ChangeLog
index 4394743..5b8c38e 100644
--- binutils/ChangeLog
+++ binutils/ChangeLog
@@ -1,3 +1,10 @@
+2008-09-20 Pascal Obry <[EMAIL PROTECTED]>
+
+ binutils/
+ * windres.c (main): Ensure that windres won't crash when
+ no parameter passed on the command line. In this case
+ we display the usage string.
+
2007-08-28 Nick Clifton <[EMAIL PROTECTED]>
* NEWS: Mention Coverity's contribution.
diff --git binutils/windres.c binutils/windres.c
index ac643ad..4574222 100644
--- binutils/windres.c
+++ binutils/windres.c
@@ -989,7 +989,7 @@ main (int argc, char **argv)
++optind;
}
- if (argc != optind)
+ if (argc != optind || argc == 1)
usage (stderr, 1);
if (input_format == RES_FORMAT_UNKNOWN)
--
1.6.0.2.307.gc4275
--
Pascal Obry
--
gpg --keyserver wwwkeys.pgp.net --recv-key C1082595
_______________________________________________
bug-binutils mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-binutils