From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp-2.sys.kth.se (smtp-2.sys.kth.se [130.237.32.160]) by krisdoz.my.domain (8.14.3/8.14.3) with ESMTP id p3UNJ138013017 for ; Sat, 30 Apr 2011 19:19:02 -0400 (EDT) Received: from mailscan-1.sys.kth.se (mailscan-1.sys.kth.se [130.237.32.91]) by smtp-2.sys.kth.se (Postfix) with ESMTP id C531C14DCA9; Sun, 1 May 2011 01:18:55 +0200 (CEST) X-Virus-Scanned: by amavisd-new at kth.se Received: from smtp-2.sys.kth.se ([130.237.32.160]) by mailscan-1.sys.kth.se (mailscan-1.sys.kth.se [130.237.32.91]) (amavisd-new, port 10024) with LMTP id RMtPG3Bvaa0A; Sun, 1 May 2011 01:18:53 +0200 (CEST) X-KTH-Auth: kristaps [213.103.216.43] X-KTH-mail-from: kristaps@bsd.lv Received: from macky.local (s213-103-216-43.cust.tele2.se [213.103.216.43]) by smtp-2.sys.kth.se (Postfix) with ESMTP id E396614D7CB; Sun, 1 May 2011 01:18:52 +0200 (CEST) Message-ID: <4DBC98DB.2070204@bsd.lv> Date: Sun, 01 May 2011 01:18:51 +0200 From: Kristaps Dzonsons User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.17) Gecko/20110414 Thunderbird/3.1.10 X-Mailinglist: mdocml-tech Reply-To: tech@mdocml.bsd.lv MIME-Version: 1.0 To: tech@mdocml.bsd.lv CC: Ingo Schwarze , Jason McIntyre Subject: Re: [PATCH] \N'nnn' protection. References: <4DBC8F27.3040600@bsd.lv> <20110430225932.GB9889@iris.usta.de> In-Reply-To: <20110430225932.GB9889@iris.usta.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit >> Enclosed is a patch to limit possible \N'nnn' escapes. \N >> transforms the number 'nnn' into its character representation and is >> marked as "for backwards compatibility" in mandoc_char(7). >> >> I can only find manuals using this for the double-quote \N'34', so >> this seems safe, but maybe one of you knows of crazy \N usage that >> would inspire me to re-think. > > None known, and little wonder, as it would be a bad idea because it's > inherently non-portable even among systems supporting \N. > >> However, throwing, e.g., the \b >> character in there will cause at least -Tps and -Tpdf to puke. >> >> Thoughts? > > Maybe isprint(3)? Ingo, That'll do it. I wasn't sure if "printable characters including the space" meant "including whitespace", i.e., newlines. However, I checked on BSD, Linux, and Mac, and it seems that this is not the case. Thus, I'll check in isprint() tomorrow. Thanks! Kristaps -- To unsubscribe send an email to tech+unsubscribe@mdocml.bsd.lv