Subject: Re: finger
To: None <kim@tac.nyc.ny.us>
From: T.SHIOZAKI <tshiozak@astec.co.jp>
List: tech-userlevel
Date: 09/12/2002 21:58:39
From: Kimmo Suominen <kim@tac.nyc.ny.us>
Subject: Re: finger
Date: Thu, 12 Sep 2002 08:45:10 -0400
Message-ID: <20020912124510.9C1657E33@beowulf.gw.com>
> 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 */
else
setlocale(LC_CTYPE, "C");
}
break;
--
Takuya SHIOZAKI / ASTEC Products, Inc.