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]
Message-ID: <CA+55aFw+Efs+um15_V6t-9rXd-U1VJS9p+_6E-m5jr87h-BPVg@mail.gmail.com>
Date:	Wed, 3 Apr 2013 08:30:21 -0700
From:	Linus Torvalds <torvalds@...ux-foundation.org>
To:	Eric Dumazet <eric.dumazet@...il.com>
Cc:	Michal Kubecek <mkubecek@...e.cz>,
	Chen Gang <gang.chen@...anux.com>,
	Wu Fengguang <fengguang.wu@...el.com>,
	Karsten Keil <isdn@...ux-pingi.de>,
	David Miller <davem@...emloft.net>,
	netdev <netdev@...r.kernel.org>, Joe Perches <joe@...ches.com>
Subject: Re: [Suggestion] ISDN: isdnloop: C grammar issue, '}' miss match 'if'
 and 'switch' statement.

On Wed, Apr 3, 2013 at 7:31 AM, Eric Dumazet <eric.dumazet@...il.com> wrote:
>
> And what is the problem exactly ?

The indentation does look completely broken.

It should still *work*, because case-statements don't actually care
about nesting (you can use a case statement to jump into other control
statements, the traditional example is the so-called "duff's device"),
but I agree with Chen Gang that it looks wrong.

I'm attaching a patch that would appear to fix the nesting, but I
haven't actually tested it. Also, regardless of that patch, the code
looks like complete and utter crap, because it sets the "i" variable
in many of the case statements, and then doesn't actually *use* it.
Finally, almost all of the case statements test for something like

    if (c->arg < ISDNLOOP_BCH) {

but if "c->arg" is out of range, it will then just break out of the
switch statement and return 0, even though it looks like it should be
an error.

Of course, nobody sane actually cares about ISDN any more, so I think
this is all pretty academic. I think even Germany (where ISDN *used*
to be very common due to telephone monopolies and odd rules) no longer
uses it. I can't imagine that anybody else does either.

But if somebody does care, and can validate my patch (if not by
actually using it, then by at least looking at it more), feel free to
take it and take my sign-off.

     Linus

Download attachment "patch.diff" of type "application/octet-stream" (4860 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ