diff options
| -rw-r--r-- | src/emacs.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/emacs.c b/src/emacs.c index 90c66cd6cbe..4297163dde0 100644 --- a/src/emacs.c +++ b/src/emacs.c | |||
| @@ -1090,6 +1090,8 @@ sort_args (argc, argv) | |||
| 1090 | { | 1090 | { |
| 1091 | options[from] = standard_args[i].nargs; | 1091 | options[from] = standard_args[i].nargs; |
| 1092 | priority[from] = standard_args[i].priority; | 1092 | priority[from] = standard_args[i].priority; |
| 1093 | if (from + standard_args[i].nargs >= argc) | ||
| 1094 | fatal ("Option `%s' requires an argument\n", argv[from]); | ||
| 1093 | from += standard_args[i].nargs; | 1095 | from += standard_args[i].nargs; |
| 1094 | goto done; | 1096 | goto done; |
| 1095 | } | 1097 | } |
| @@ -1126,6 +1128,8 @@ sort_args (argc, argv) | |||
| 1126 | this option uses just one argv element. */ | 1128 | this option uses just one argv element. */ |
| 1127 | if (equals != 0) | 1129 | if (equals != 0) |
| 1128 | options[from] = 0; | 1130 | options[from] = 0; |
| 1131 | if (from + options[from] >= argc) | ||
| 1132 | fatal ("Option `%s' requires an argument\n", argv[from]); | ||
| 1129 | from += options[from]; | 1133 | from += options[from]; |
| 1130 | } | 1134 | } |
| 1131 | } | 1135 | } |