You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@httpd.apache.org by bu...@apache.org on 2006/06/23 23:30:43 UTC

DO NOT REPLY [Bug 39895] New: - apr_os_strerror fails on WinCE (or when _UNICODE is set)

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=39895>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=39895

           Summary: apr_os_strerror fails on WinCE (or when _UNICODE is set)
           Product: APR
           Version: HEAD
          Platform: Other
        OS/Version: other
            Status: NEW
          Severity: normal
          Priority: P2
         Component: APR
        AssignedTo: bugs@httpd.apache.org
        ReportedBy: carnold@apache.org


apr_os_strerror which provides message for operating system messages for Windows
does not consistently modify the lpBuffer and nSize arguments to the call to
FormatMessage which could result in overrunning the passed buffer on WinCE or
any build when _UNICODE is defined.  

The character lpBuffer argument is cast to LPTSTR (char* or wchar_t* depending
on state of _UNICODE).  The nSize argument is supposed to be the number of
TCHAR's available in the buffer, but is not adjusted for the size of TCHAR.  If
_UNICODE is set, the nSize value will be twice the proper value.

The patch addresses the issue by explicitly specifying FormatMessageA for non-CE
builds and casting the buffer to LPSTR instead of LPTSTR.  This will cause the
code to always compile to the current behavior for "normal" Windows regardless
of the state of _UNICODE.

For Windows CE, the invariant locale is specified instead of using the user's
current language which should allow the naive in-place conversion of the message
to US-ASCII to produce reasonable diagnostic messages.  Since APR messages are
not localized, it should be acceptible that OS message are not localized either.
on that platform.  A more capable conversion using WideCharToMultiByte would
require allocating a new buffer for the result and would introduce more
complexity.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 39895] - apr_os_strerror fails on WinCE (or when _UNICODE is set)

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=39895>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=39895





------- Additional Comments From carnold@apache.org  2006-06-23 21:32 -------
Created an attachment (id=18527)
 --> (http://issues.apache.org/bugzilla/attachment.cgi?id=18527&action=view)
Explicitly call FormatMessageA on Win32, naive transcode on WinCE 


-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 39895] - apr_os_strerror fails on WinCE (or when _UNICODE is set)

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=39895>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=39895


wrowe@apache.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|bugs@httpd.apache.org       |bugs@apr.apache.org




------- Additional Comments From wrowe@apache.org  2006-09-19 19:54 -------
Mass reassign the 44 open apr-bugs to apr bug list

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org