Screenshot instructions:
Windows
Mac
Red Hat Linux
Ubuntu
Click URL instructions:
Right-click on ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)
From: SourceForge.net <noreply@so...> - 2009-06-06 16:46:18
|
Bugs item #2802293, was opened at 2009-06-06 11:46 Message generated for change (Tracker Item Submitted) made by tjbramer You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=102435&aid=2802293&group_id=2435 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: binutils Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Tom Bramer (tjbramer) Assigned to: Nobody/Anonymous (nobody) Summary: windres crashes processing files with UTF-8 encoding. Initial Comment: OS: Windows XP SP2 windres, version 2.18 and up, when processing an rc file that contains at least one quoted string, will crash with an access violation (on dereference of NULL pointer) if the code page is explicitly set to 65001 (UTF-8). Here is an example input that causes the issue: ======================== BEGIN ========================= #define IDS_STRING1 1 #pragma code_page(65001) STRINGTABLE BEGIN IDS_STRING1 "Any string will do..." END ========================= END ========================== The cause: When calling the MultiByteToWideChar function with a code page of 65000, 65001, or others (see http://msdn.microsoft.com/en-us/library/dd319072(VS.85).aspx), the dwFlags parameter must be 0, unless when using Windows XP and later, in which it may be 0 or MB_ERR_INVALID_CHARS. If the value given for dwFlags is in fact set to a value other than the aforementioned valid cases, the function will set the last error to ERROR_INVALID_FLAGS. The wind_MultiByteToWideChar function always passes MB_PRECOMPOSED as the dwFlags parameter to MultiByteToWideChar, causing the function to fail and not convert the UTF-7/8 string to UTF-16. The wind_MultiByteToWideChar function assumes that the MultiByteToWideChar function is successful, when in reality, the wide character buffer still contains uninitialized data. What worked for me: ======================== BEGIN ========================= --- binutils-2.19.1/binutils/winduni.c 2007-07-05 12:54:44 -0400 +++ binutils-2.19.1-new/binutils/winduni.c 2009-05-17 17:52:33 -0400 @@ -661,7 +661,15 @@ wind_MultiByteToWideChar (rc_uint_type c rc_uint_type ret = 0; #if defined (_WIN32) || defined (__CYGWIN__) - ret = (rc_uint_type) MultiByteToWideChar (cp, MB_PRECOMPOSED, + rc_uint_type conv_flags = MB_PRECOMPOSED; + + /* MB_PRECOMPOSED is not allowed for UTF-7 or UTF-8. + MultiByteToWideChar will set the last error to ERROR_INVALID_FLAGS + if we do anyways. */ + if (cp == CP_UTF8 || cp == CP_UTF7) + conv_flags = 0; + + ret = (rc_uint_type) MultiByteToWideChar (cp, conv_flags, mb, -1, u, u_len); /* Convert to bytes. */ ret *= sizeof (unichar); ======================== END ========================= ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=102435&aid=2802293&group_id=2435 |
From: SourceForge.net <noreply@so...> - 2009-06-08 12:04:27
|
Bugs item #2802293, was opened at 2009-06-06 12:46 Message generated for change (Comment added) made by ir0nh34d You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=102435&aid=2802293&group_id=2435 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: binutils Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Tom Bramer (tjbramer) >Assigned to: Chris Sutcliffe (ir0nh34d) Summary: windres crashes processing files with UTF-8 encoding. Initial Comment: OS: Windows XP SP2 windres, version 2.18 and up, when processing an rc file that contains at least one quoted string, will crash with an access violation (on dereference of NULL pointer) if the code page is explicitly set to 65001 (UTF-8). Here is an example input that causes the issue: ======================== BEGIN ========================= #define IDS_STRING1 1 #pragma code_page(65001) STRINGTABLE BEGIN IDS_STRING1 "Any string will do..." END ========================= END ========================== The cause: When calling the MultiByteToWideChar function with a code page of 65000, 65001, or others (see http://msdn.microsoft.com/en-us/library/dd319072(VS.85).aspx), the dwFlags parameter must be 0, unless when using Windows XP and later, in which it may be 0 or MB_ERR_INVALID_CHARS. If the value given for dwFlags is in fact set to a value other than the aforementioned valid cases, the function will set the last error to ERROR_INVALID_FLAGS. The wind_MultiByteToWideChar function always passes MB_PRECOMPOSED as the dwFlags parameter to MultiByteToWideChar, causing the function to fail and not convert the UTF-7/8 string to UTF-16. The wind_MultiByteToWideChar function assumes that the MultiByteToWideChar function is successful, when in reality, the wide character buffer still contains uninitialized data. What worked for me: ======================== BEGIN ========================= --- binutils-2.19.1/binutils/winduni.c 2007-07-05 12:54:44 -0400 +++ binutils-2.19.1-new/binutils/winduni.c 2009-05-17 17:52:33 -0400 @@ -661,7 +661,15 @@ wind_MultiByteToWideChar (rc_uint_type c rc_uint_type ret = 0; #if defined (_WIN32) || defined (__CYGWIN__) - ret = (rc_uint_type) MultiByteToWideChar (cp, MB_PRECOMPOSED, + rc_uint_type conv_flags = MB_PRECOMPOSED; + + /* MB_PRECOMPOSED is not allowed for UTF-7 or UTF-8. + MultiByteToWideChar will set the last error to ERROR_INVALID_FLAGS + if we do anyways. */ + if (cp == CP_UTF8 || cp == CP_UTF7) + conv_flags = 0; + + ret = (rc_uint_type) MultiByteToWideChar (cp, conv_flags, mb, -1, u, u_len); /* Convert to bytes. */ ret *= sizeof (unichar); ======================== END ========================= ---------------------------------------------------------------------- >Comment By: Chris Sutcliffe (ir0nh34d) Date: 2009-06-08 08:03 Message: I've raised this patch to the attention of the upstream binutils maintainers, since MinGW binutils is compiled from the Vanilla binutils sources. Please see the email chain here for details: http://sourceware.org/ml/binutils/2009-06/msg00136.html Quoting Nick Clifton from the email chain mentioned above: "Ideally they should open a bug report at http://sourceware.org/bugzilla and include the patch as an uploaded file. It will help if this bug report also includes a small test case that we can use to reproduce the problem locally. If your user has run any regression tests, (to make sure that the patch does not introduce any new bugs), then mentioning what tests they ran would also be helpful." Thank you for the patch! ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=102435&aid=2802293&group_id=2435 |
From: SourceForge.net <noreply@so...> - 2009-06-09 03:13:18
|
Bugs item #2802293, was opened at 2009-06-06 11:46 Message generated for change (Comment added) made by tjbramer You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=102435&aid=2802293&group_id=2435 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: binutils Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Tom Bramer (tjbramer) Assigned to: Chris Sutcliffe (ir0nh34d) Summary: windres crashes processing files with UTF-8 encoding. Initial Comment: OS: Windows XP SP2 windres, version 2.18 and up, when processing an rc file that contains at least one quoted string, will crash with an access violation (on dereference of NULL pointer) if the code page is explicitly set to 65001 (UTF-8). Here is an example input that causes the issue: ======================== BEGIN ========================= #define IDS_STRING1 1 #pragma code_page(65001) STRINGTABLE BEGIN IDS_STRING1 "Any string will do..." END ========================= END ========================== The cause: When calling the MultiByteToWideChar function with a code page of 65000, 65001, or others (see http://msdn.microsoft.com/en-us/library/dd319072(VS.85).aspx), the dwFlags parameter must be 0, unless when using Windows XP and later, in which it may be 0 or MB_ERR_INVALID_CHARS. If the value given for dwFlags is in fact set to a value other than the aforementioned valid cases, the function will set the last error to ERROR_INVALID_FLAGS. The wind_MultiByteToWideChar function always passes MB_PRECOMPOSED as the dwFlags parameter to MultiByteToWideChar, causing the function to fail and not convert the UTF-7/8 string to UTF-16. The wind_MultiByteToWideChar function assumes that the MultiByteToWideChar function is successful, when in reality, the wide character buffer still contains uninitialized data. What worked for me: ======================== BEGIN ========================= --- binutils-2.19.1/binutils/winduni.c 2007-07-05 12:54:44 -0400 +++ binutils-2.19.1-new/binutils/winduni.c 2009-05-17 17:52:33 -0400 @@ -661,7 +661,15 @@ wind_MultiByteToWideChar (rc_uint_type c rc_uint_type ret = 0; #if defined (_WIN32) || defined (__CYGWIN__) - ret = (rc_uint_type) MultiByteToWideChar (cp, MB_PRECOMPOSED, + rc_uint_type conv_flags = MB_PRECOMPOSED; + + /* MB_PRECOMPOSED is not allowed for UTF-7 or UTF-8. + MultiByteToWideChar will set the last error to ERROR_INVALID_FLAGS + if we do anyways. */ + if (cp == CP_UTF8 || cp == CP_UTF7) + conv_flags = 0; + + ret = (rc_uint_type) MultiByteToWideChar (cp, conv_flags, mb, -1, u, u_len); /* Convert to bytes. */ ret *= sizeof (unichar); ======================== END ========================= ---------------------------------------------------------------------- >Comment By: Tom Bramer (tjbramer) Date: 2009-06-08 22:13 Message: There is a bug report on sourceware's bugzilla already: http://sourceware.org/bugzilla/show_bug.cgi?id=10165 ---------------------------------------------------------------------- Comment By: Chris Sutcliffe (ir0nh34d) Date: 2009-06-08 07:03 Message: I've raised this patch to the attention of the upstream binutils maintainers, since MinGW binutils is compiled from the Vanilla binutils sources. Please see the email chain here for details: http://sourceware.org/ml/binutils/2009-06/msg00136.html Quoting Nick Clifton from the email chain mentioned above: "Ideally they should open a bug report at http://sourceware.org/bugzilla and include the patch as an uploaded file. It will help if this bug report also includes a small test case that we can use to reproduce the problem locally. If your user has run any regression tests, (to make sure that the patch does not introduce any new bugs), then mentioning what tests they ran would also be helpful." Thank you for the patch! ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=102435&aid=2802293&group_id=2435 |
From: SourceForge.net <noreply@so...> - 2009-06-09 12:20:15
|
Bugs item #2802293, was opened at 2009-06-06 12:46 Message generated for change (Comment added) made by ir0nh34d You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=102435&aid=2802293&group_id=2435 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: binutils Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Tom Bramer (tjbramer) Assigned to: Chris Sutcliffe (ir0nh34d) Summary: windres crashes processing files with UTF-8 encoding. Initial Comment: OS: Windows XP SP2 windres, version 2.18 and up, when processing an rc file that contains at least one quoted string, will crash with an access violation (on dereference of NULL pointer) if the code page is explicitly set to 65001 (UTF-8). Here is an example input that causes the issue: ======================== BEGIN ========================= #define IDS_STRING1 1 #pragma code_page(65001) STRINGTABLE BEGIN IDS_STRING1 "Any string will do..." END ========================= END ========================== The cause: When calling the MultiByteToWideChar function with a code page of 65000, 65001, or others (see http://msdn.microsoft.com/en-us/library/dd319072(VS.85).aspx), the dwFlags parameter must be 0, unless when using Windows XP and later, in which it may be 0 or MB_ERR_INVALID_CHARS. If the value given for dwFlags is in fact set to a value other than the aforementioned valid cases, the function will set the last error to ERROR_INVALID_FLAGS. The wind_MultiByteToWideChar function always passes MB_PRECOMPOSED as the dwFlags parameter to MultiByteToWideChar, causing the function to fail and not convert the UTF-7/8 string to UTF-16. The wind_MultiByteToWideChar function assumes that the MultiByteToWideChar function is successful, when in reality, the wide character buffer still contains uninitialized data. What worked for me: ======================== BEGIN ========================= --- binutils-2.19.1/binutils/winduni.c 2007-07-05 12:54:44 -0400 +++ binutils-2.19.1-new/binutils/winduni.c 2009-05-17 17:52:33 -0400 @@ -661,7 +661,15 @@ wind_MultiByteToWideChar (rc_uint_type c rc_uint_type ret = 0; #if defined (_WIN32) || defined (__CYGWIN__) - ret = (rc_uint_type) MultiByteToWideChar (cp, MB_PRECOMPOSED, + rc_uint_type conv_flags = MB_PRECOMPOSED; + + /* MB_PRECOMPOSED is not allowed for UTF-7 or UTF-8. + MultiByteToWideChar will set the last error to ERROR_INVALID_FLAGS + if we do anyways. */ + if (cp == CP_UTF8 || cp == CP_UTF7) + conv_flags = 0; + + ret = (rc_uint_type) MultiByteToWideChar (cp, conv_flags, mb, -1, u, u_len); /* Convert to bytes. */ ret *= sizeof (unichar); ======================== END ========================= ---------------------------------------------------------------------- >Comment By: Chris Sutcliffe (ir0nh34d) Date: 2009-06-09 08:20 Message: Thank you for posting this to the binutils bug tracker. I'll leave this bug report open until I validate that this patch has made it in to mainline windres. ---------------------------------------------------------------------- Comment By: Tom Bramer (tjbramer) Date: 2009-06-08 23:13 Message: There is a bug report on sourceware's bugzilla already: http://sourceware.org/bugzilla/show_bug.cgi?id=10165 ---------------------------------------------------------------------- Comment By: Chris Sutcliffe (ir0nh34d) Date: 2009-06-08 08:03 Message: I've raised this patch to the attention of the upstream binutils maintainers, since MinGW binutils is compiled from the Vanilla binutils sources. Please see the email chain here for details: http://sourceware.org/ml/binutils/2009-06/msg00136.html Quoting Nick Clifton from the email chain mentioned above: "Ideally they should open a bug report at http://sourceware.org/bugzilla and include the patch as an uploaded file. It will help if this bug report also includes a small test case that we can use to reproduce the problem locally. If your user has run any regression tests, (to make sure that the patch does not introduce any new bugs), then mentioning what tests they ran would also be helpful." Thank you for the patch! ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=102435&aid=2802293&group_id=2435 |
From: SourceForge.net <noreply@so...> - 2009-07-14 19:44:57
|
Bugs item #2802293, was opened at 2009-06-06 17:46 Message generated for change (Comment added) made by coudert You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=102435&aid=2802293&group_id=2435 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: binutils Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Tom Bramer (tjbramer) Assigned to: Chris Sutcliffe (ir0nh34d) Summary: windres crashes processing files with UTF-8 encoding. Initial Comment: OS: Windows XP SP2 windres, version 2.18 and up, when processing an rc file that contains at least one quoted string, will crash with an access violation (on dereference of NULL pointer) if the code page is explicitly set to 65001 (UTF-8). Here is an example input that causes the issue: ======================== BEGIN ========================= #define IDS_STRING1 1 #pragma code_page(65001) STRINGTABLE BEGIN IDS_STRING1 "Any string will do..." END ========================= END ========================== The cause: When calling the MultiByteToWideChar function with a code page of 65000, 65001, or others (see http://msdn.microsoft.com/en-us/library/dd319072(VS.85).aspx), the dwFlags parameter must be 0, unless when using Windows XP and later, in which it may be 0 or MB_ERR_INVALID_CHARS. If the value given for dwFlags is in fact set to a value other than the aforementioned valid cases, the function will set the last error to ERROR_INVALID_FLAGS. The wind_MultiByteToWideChar function always passes MB_PRECOMPOSED as the dwFlags parameter to MultiByteToWideChar, causing the function to fail and not convert the UTF-7/8 string to UTF-16. The wind_MultiByteToWideChar function assumes that the MultiByteToWideChar function is successful, when in reality, the wide character buffer still contains uninitialized data. What worked for me: ======================== BEGIN ========================= --- binutils-2.19.1/binutils/winduni.c 2007-07-05 12:54:44 -0400 +++ binutils-2.19.1-new/binutils/winduni.c 2009-05-17 17:52:33 -0400 @@ -661,7 +661,15 @@ wind_MultiByteToWideChar (rc_uint_type c rc_uint_type ret = 0; #if defined (_WIN32) || defined (__CYGWIN__) - ret = (rc_uint_type) MultiByteToWideChar (cp, MB_PRECOMPOSED, + rc_uint_type conv_flags = MB_PRECOMPOSED; + + /* MB_PRECOMPOSED is not allowed for UTF-7 or UTF-8. + MultiByteToWideChar will set the last error to ERROR_INVALID_FLAGS + if we do anyways. */ + if (cp == CP_UTF8 || cp == CP_UTF7) + conv_flags = 0; + + ret = (rc_uint_type) MultiByteToWideChar (cp, conv_flags, mb, -1, u, u_len); /* Convert to bytes. */ ret *= sizeof (unichar); ======================== END ========================= ---------------------------------------------------------------------- Comment By: François-Xavier Coudert (coudert) Date: 2009-07-14 20:44 Message: Patch was commited to binutils mainline on 2009-06-09. I think this issue should be closed. ---------------------------------------------------------------------- Comment By: Chris Sutcliffe (ir0nh34d) Date: 2009-06-09 13:20 Message: Thank you for posting this to the binutils bug tracker. I'll leave this bug report open until I validate that this patch has made it in to mainline windres. ---------------------------------------------------------------------- Comment By: Tom Bramer (tjbramer) Date: 2009-06-09 04:13 Message: There is a bug report on sourceware's bugzilla already: http://sourceware.org/bugzilla/show_bug.cgi?id=10165 ---------------------------------------------------------------------- Comment By: Chris Sutcliffe (ir0nh34d) Date: 2009-06-08 13:03 Message: I've raised this patch to the attention of the upstream binutils maintainers, since MinGW binutils is compiled from the Vanilla binutils sources. Please see the email chain here for details: http://sourceware.org/ml/binutils/2009-06/msg00136.html Quoting Nick Clifton from the email chain mentioned above: "Ideally they should open a bug report at http://sourceware.org/bugzilla and include the patch as an uploaded file. It will help if this bug report also includes a small test case that we can use to reproduce the problem locally. If your user has run any regression tests, (to make sure that the patch does not introduce any new bugs), then mentioning what tests they ran would also be helpful." Thank you for the patch! ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=102435&aid=2802293&group_id=2435 |
From: SourceForge.net <noreply@so...> - 2009-07-15 11:48:01
|
Bugs item #2802293, was opened at 2009-06-06 12:46 Message generated for change (Comment added) made by ir0nh34d You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=102435&aid=2802293&group_id=2435 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: binutils Group: None >Status: Closed >Resolution: Accepted Priority: 5 Private: No Submitted By: Tom Bramer (tjbramer) Assigned to: Chris Sutcliffe (ir0nh34d) Summary: windres crashes processing files with UTF-8 encoding. Initial Comment: OS: Windows XP SP2 windres, version 2.18 and up, when processing an rc file that contains at least one quoted string, will crash with an access violation (on dereference of NULL pointer) if the code page is explicitly set to 65001 (UTF-8). Here is an example input that causes the issue: ======================== BEGIN ========================= #define IDS_STRING1 1 #pragma code_page(65001) STRINGTABLE BEGIN IDS_STRING1 "Any string will do..." END ========================= END ========================== The cause: When calling the MultiByteToWideChar function with a code page of 65000, 65001, or others (see http://msdn.microsoft.com/en-us/library/dd319072(VS.85).aspx), the dwFlags parameter must be 0, unless when using Windows XP and later, in which it may be 0 or MB_ERR_INVALID_CHARS. If the value given for dwFlags is in fact set to a value other than the aforementioned valid cases, the function will set the last error to ERROR_INVALID_FLAGS. The wind_MultiByteToWideChar function always passes MB_PRECOMPOSED as the dwFlags parameter to MultiByteToWideChar, causing the function to fail and not convert the UTF-7/8 string to UTF-16. The wind_MultiByteToWideChar function assumes that the MultiByteToWideChar function is successful, when in reality, the wide character buffer still contains uninitialized data. What worked for me: ======================== BEGIN ========================= --- binutils-2.19.1/binutils/winduni.c 2007-07-05 12:54:44 -0400 +++ binutils-2.19.1-new/binutils/winduni.c 2009-05-17 17:52:33 -0400 @@ -661,7 +661,15 @@ wind_MultiByteToWideChar (rc_uint_type c rc_uint_type ret = 0; #if defined (_WIN32) || defined (__CYGWIN__) - ret = (rc_uint_type) MultiByteToWideChar (cp, MB_PRECOMPOSED, + rc_uint_type conv_flags = MB_PRECOMPOSED; + + /* MB_PRECOMPOSED is not allowed for UTF-7 or UTF-8. + MultiByteToWideChar will set the last error to ERROR_INVALID_FLAGS + if we do anyways. */ + if (cp == CP_UTF8 || cp == CP_UTF7) + conv_flags = 0; + + ret = (rc_uint_type) MultiByteToWideChar (cp, conv_flags, mb, -1, u, u_len); /* Convert to bytes. */ ret *= sizeof (unichar); ======================== END ========================= ---------------------------------------------------------------------- >Comment By: Chris Sutcliffe (ir0nh34d) Date: 2009-07-15 07:47 Message: Thank you for the heads up about this patch being applied upstream. ---------------------------------------------------------------------- Comment By: François-Xavier Coudert (coudert) Date: 2009-07-14 15:44 Message: Patch was commited to binutils mainline on 2009-06-09. I think this issue should be closed. ---------------------------------------------------------------------- Comment By: Chris Sutcliffe (ir0nh34d) Date: 2009-06-09 08:20 Message: Thank you for posting this to the binutils bug tracker. I'll leave this bug report open until I validate that this patch has made it in to mainline windres. ---------------------------------------------------------------------- Comment By: Tom Bramer (tjbramer) Date: 2009-06-08 23:13 Message: There is a bug report on sourceware's bugzilla already: http://sourceware.org/bugzilla/show_bug.cgi?id=10165 ---------------------------------------------------------------------- Comment By: Chris Sutcliffe (ir0nh34d) Date: 2009-06-08 08:03 Message: I've raised this patch to the attention of the upstream binutils maintainers, since MinGW binutils is compiled from the Vanilla binutils sources. Please see the email chain here for details: http://sourceware.org/ml/binutils/2009-06/msg00136.html Quoting Nick Clifton from the email chain mentioned above: "Ideally they should open a bug report at http://sourceware.org/bugzilla and include the patch as an uploaded file. It will help if this bug report also includes a small test case that we can use to reproduce the problem locally. If your user has run any regression tests, (to make sure that the patch does not introduce any new bugs), then mentioning what tests they ran would also be helpful." Thank you for the patch! ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=102435&aid=2802293&group_id=2435 |