Back on March 11, Dan Dexter had reported a problem with htdig hanging on
one of his documents. The problem turned out to be accented characters
in an unquoted string in a meta tag, which isalnum() on his system choked
on. The program hung in the Configuration::Add() function, which HTML.cc
uses to parse the tag. This patch prevents that hang, on ill behaved
systems:
--- htlib/Configuration.cc.alnumbug Tue Feb 16 23:03:56 1999
+++ htlib/Configuration.cc Fri Mar 19 10:33:28 1999
@@ -62,6 +62,11 @@ void Configuration::Add(char *str)
name = 0;
if (!isalpha(*str))
break;
+ // Some isalnum() implementations don't allow all the letters that
+ // isalpha() does, e.g. accented ones. They're not POSIX.2 compliant
+ // but we won't punish them with an infinite loop...
+ if (!isalnum(*str))
+ break;
while (isalnum(*str) || *str == '-' || *str == '_')
name << *str++;
--
Gilles R. Detillieux E-mail: <[EMAIL PROTECTED]>
Spinal Cord Research Centre WWW: http://www.scrc.umanitoba.ca/~grdetil
Dept. Physiology, U. of Manitoba Phone: (204)789-3766
Winnipeg, MB R3E 3J7 (Canada) Fax: (204)789-3930
------------------------------------
To unsubscribe from the htdig mailing list, send a message to
[EMAIL PROTECTED] containing the single word "unsubscribe" in
the SUBJECT of the message.