From c79d9153b452d20bff91d2fc347588e89e69043f Mon Sep 17 00:00:00 2001 From: asac Date: Wed, 21 Feb 2007 03:34:16 +0100 Subject: [PATCH] bz331818-fix-crash-xpidl-zero-arguments + patch that fixes a crash if xpidl gets not enough arguments --- xpcom/typelib/xpidl/xpidl.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/xpcom/typelib/xpidl/xpidl.c b/xpcom/typelib/xpidl/xpidl.c index 74f2e9c..9d5c778 100644 --- a/xpcom/typelib/xpidl/xpidl.c +++ b/xpcom/typelib/xpidl/xpidl.c @@ -260,7 +260,7 @@ int main(int argc, char *argv[]) xpidl_usage(argc, argv); return 1; } - if (argc != i + 1) { + if (argc > i + 1) { fprintf(stderr, "ERROR: extra arguments after input file\n"); } @@ -268,7 +268,7 @@ int main(int argc, char *argv[]) * Don't try to process multiple files, given that we don't handle -o * multiply. */ - if (xpidl_process_idl(argv[i], inc_head, file_basename, mode)) + if ((i < argc) && xpidl_process_idl(argv[i], inc_head, file_basename, mode)) return 0; return 1; -- 1.4.4.4