[CRIU] Re: [PATCH] crtools: check optind is valid before parsing
command argument
Pavel Emelyanov
xemul at parallels.com
Sat Jul 28 01:08:52 EDT 2012
On 07/26/2012 03:33 PM, Kinsbursky Stanislav wrote:
> Signed-off-by: Stanislav Kinsbursky <skinsbursky at openvz.org>
>
> ---
> crtools.c | 3 +++
> 1 files changed, 3 insertions(+), 0 deletions(-)
>
> diff --git a/crtools.c b/crtools.c
> index 3987a87..36209cb 100644
> --- a/crtools.c
> +++ b/crtools.c
> @@ -186,6 +186,9 @@ int main(int argc, char *argv[])
> return -1;
> }
>
> + if (optind >= argc)
> + goto usage;
> +
> if (strcmp(argv[optind], "dump") &&
> strcmp(argv[optind], "restore") &&
> strcmp(argv[optind], "show") &&
>
Applied
More information about the CRIU
mailing list