Subject: Re: finger
To: None <>
List: tech-userlevel
Date: 09/12/2002 21:58:39
From: Kimmo Suominen <>
Subject: Re: finger
Date: Thu, 12 Sep 2002 08:45:10 -0400
Message-ID: <>

> Also, what about the security implications of -i with multi-byte
> character sets?  I don't see anything in the code for protecting
> against those.

If isprint() is called with a fragment of a multibite character,
it just fail.
Thus, it is unnecessary to check whether the current locale is multibyte.

If you prefer to check it, I can fix it easily:

                case 'i':
                        if (!iflag && setlocale(LC_CTYPE, "")!=NULL) {
                                if (MB_CUR_MAX == 1)
                                        iflag = 1;      /* partial i18n mode */
                                        setlocale(LC_CTYPE, "C");

Takuya SHIOZAKI / ASTEC Products, Inc.