lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 25 Jul 2011 10:01:31 -0400
From:	Steven Rostedt <rostedt@...dmis.org>
To:	Vaibhav Nagarnaik <vnagarnaik@...gle.com>
Cc:	Michael Rubin <mrubin@...gle.com>,
	David Sharp <dhsharp@...gle.com>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 3/4] trace-cmd: Handle opcode parsing error

On Fri, 2011-07-15 at 20:00 -0700, Vaibhav Nagarnaik wrote:
>  
>  /* Note, *tok does not get freed, but will most likely be saved */
> @@ -1706,7 +1706,10 @@ process_op(struct event_format *event, struct print_arg *arg, char **tok)
>  		arg->op.op = token;
>  		arg->op.left = left;
>  
> -		set_op_prio(arg);
> +		if (-1 == set_op_prio(arg)) {

I'm fine with the patch up to here. I understand the constant first
compare, but it doesn't make sense here. Either use:

	if (set_op_prio(arg) < 0) ...
 or
	if (set_op_prio(arg) == -1)...


The reason the -1 == doesn't make sense is because:

	if (set_op_proi(arg) = -1)

would fail too.

And it is much easier to read.

-- Steve

> +			event->flags |= EVENT_FL_FAILED;
> +			goto out_free;
> +		}
>  
>  		type = read_token_item(&token);
>  		*tok = token;


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ