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: <dd7830f1-be51-29a-b77-64a5f4c34a6a@linux.intel.com>
Date:   Wed, 8 Jun 2022 12:54:01 +0300 (EEST)
From:   Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>
To:     Jiri Slaby <jslaby@...e.cz>
cc:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        linux-serial <linux-serial@...r.kernel.org>,
        LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 03/36] tty/vt: consolemap: define UNI_* macros for
 constants

On Wed, 8 Jun 2022, Jiri Slaby wrote:

> On 07. 06. 22, 15:21, Ilpo Järvinen wrote:
> > On Tue, 7 Jun 2022, Jiri Slaby wrote:
> > 
> > > The code uses constants for sizes of dictionary substructures on many
> > > places. Define 3 macros and use them in the code, so that loop bounds,
> > > local variables and the dictionary always match. (And the loop bounds
> > > are obvious now too.)
> > > 
> > > Signed-off-by: Jiri Slaby <jslaby@...e.cz>
> > 
> > Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>
> > 
> > > -			for (k = 0; k < 64; k++) {
> > > +			for (k = 0; k < UNI_ROW_GLYPHS; k++) {
> > >   				glyph = p2[k];
> > >   				if (glyph >= 0 && glyph < MAX_GLYPH
> > >   					       && q[glyph] < 32)
> > 
> > Probably unrelated to this change but what's that < 32? It seems to appear
> > twice related to the inverse mapping (and you didn't end up naming it).
> 
> That's ascii C0 test _IMO_.

Ok, that's what I though it must be. But then this code seems even more 
odd to me, why it sets the inverse again but only if it's a control 
character...

Maybe this gives some hint why but it's unintelligible to me:
			/* prefer '-' above SHY etc. */
Both that quoted - and soft hyphen (SHY) are >= 32. So it kind of matches 
to what the if does, but it completely fails to explain why preference is 
the different way around with the control chars.

Btw, for set_inverse_transl(), q -> inv rename would still be useful on 
top of the other variable renames.

-- 
 i.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ