To comment on the following update, log in, then open the issue:
http://www.openoffice.org/issues/show_bug.cgi?id=92736
                 Issue #|92736
                 Summary|Crash in hunspell with Windows non-pro versions
               Component|Word processor
                 Version|DEV300m26
                Platform|All
                     URL|
              OS/Version|All
                  Status|NEW
       Status whiteboard|
                Keywords|
              Resolution|
              Issue type|DEFECT
                Priority|P3
            Subcomponent|code
             Assigned to|tl
             Reported by|tl





------- Additional comments from [EMAIL PROTECTED] Wed Aug 13 08:12:34 +0000 
2008 -------
In hunspells code (at least in phonet.c) there are calls like
  isalpha(word[i+k])
and
  isdigit (*s)

Which may cause the program to crash with in Windows C runtime library because
of running into assertions.

The problem is the usage of function like
      int isalnum(int c);
       int isalpha(int c);
       int isascii(int c);
       int isblank(int c);
       int iscntrl(int c);
       int isdigit(int c);
       int isgraph(int c);
       int islower(int c);
       int isprint(int c);
       int ispunct(int c);
       int isspace(int c);
       int isupper(int c);
       int isxdigit(int c);
Which are declared to take a (signed) int as parameter.
When those function are called for 'char' type paramters like
    const char * s;
    char word[MAXPHONETUTF8LEN + 1];
in phonet.c and they hold values from the higher half of the code page (chars
>127) e.g. for accented characters or German Umlaute those are represented as
signed chars and thus there value is negative (e.g. such as -55) when that value
is handed over as int parameter sign propagation comes into effect and the
resulting in will still be negative (-55). But interpreted as unsigned int it's
value is higher than 256 and the Windows runtime assertion will cause the
program to crash.

Solution:
When calling the above listed function all arguments must be converted to
unsigned character first before calling them!
That is the code needs to looks like
  isalpha((unsigned char) word[i+k])
and
  isdigit ((unsigned char) *s)

You Probably like to introduce an inline functions like
int MyIsAlpha(char c)
{
  return isalpha((unsigned char) c)
}
for better handling of this problem...

---------------------------------------------------------------------
Please do not reply to this automatically generated notification from
Issue Tracker. Please log onto the website and enter your comments.
http://qa.openoffice.org/issue_handling/project_issues.html#notification

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to