|
View:
New views
2 Messages
—
Rating Filter:
Alert me
|
|
|
[jira] Created: (STDCXX-891) [HP aCC 6.16] warning 4232: potential misaligned access in iso2022.cpp[HP aCC 6.16] warning 4232: potential misaligned access in iso2022.cpp
---------------------------------------------------------------------- Key: STDCXX-891 URL: https://issues.apache.org/jira/browse/STDCXX-891 Project: C++ Standard Library Issue Type: Bug Components: 22. Localization Affects Versions: 4.2.0, 4.1.4, 4.1.3, 4.1.2 Environment: aCC: HP C/aC++ B3910B A.06.16 [Nov 26 2007] Reporter: Martin Sebor Fix For: 4.2.2 The cast from {{mbstate_t*}} to {{unsigned short*}} in [{{iso2022.cpp}}|http://svn.apache.org/viewvc/stdcxx/trunk/src/iso2022.cpp] and subsequently dereferencing the pointer is unsafe because we don't know the alignment requirement of {{mbstate_t}} and because the type itself might be smaller that {{unsigned short}}, including as small as plain {{char}} as happens to be the case on IRIX. {noformat} aCC -c -mt -I$(TOPDIR)/include -I$(BUILDDIR)/include -AA +O2 +DD64 +w \ +W392 +W655 +W684 +W818 +W819 +W849 +W2193 +W2236 +W2261 \ +W2340 +W2401 +W2487 +W4227 +W4229 +W4231 +W4235 +W4237 \ +W4249 +W4255 +W4272 +W4284 +W4285 +W4286 +Z $(TOPDIR)/src/iso2022.cpp "$(TOPDIR)/src/iso2022.cpp", line 472: warning #4232-D: conversion from "mbstate_t *" to a more strictly aligned type "unsigned short *" may cause misaligned access _RWSTD_REINTERPRET_CAST (ISO_2022_STATE_INDEX_T*, &state); ^ "$(TOPDIR)/src/iso2022.cpp", line 766, procedure __rw::__rw_iso2022jp_designate: warning #20200-D: Potential null pointer dereference through esc is detected (null definition:$(TOPDIR)/src/iso2022.cpp, line 679) "$(TOPDIR)/src/iso2022.cpp", line 1543, procedure __rw::__rw_ucs4_to_interm: warning #20206-D: Out of bound access (buffer "db_array" byte range is [0 - 11], access range at [0 - 23]) "$(TOPDIR)/src/iso2022.cpp", line 1588, procedure __rw::__rw_ucs4_to_interm: warning #20206-D: Out of bound access (buffer "db_array" byte range is [0 - 11], access range at [0 - 23]) {noformat} -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
|
|
Updated: (STDCXX-891) [HP aCC 6.16] warning 4232: potential misaligned access in iso2022.cpp[ https://issues.apache.org/jira/browse/STDCXX-891?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Martin Sebor updated STDCXX-891: -------------------------------- Priority: Minor (was: Major) Lowered Priority as there is no test case showing a runtime error. > [HP aCC 6.16] warning 4232: potential misaligned access in iso2022.cpp > ---------------------------------------------------------------------- > > Key: STDCXX-891 > URL: https://issues.apache.org/jira/browse/STDCXX-891 > Project: C++ Standard Library > Issue Type: Bug > Components: 22. Localization > Affects Versions: 4.1.2, 4.1.3, 4.1.4, 4.2.0 > Environment: aCC: HP C/aC++ B3910B A.06.16 [Nov 26 2007] > Reporter: Martin Sebor > Priority: Minor > Fix For: 4.2.2 > > Original Estimate: 2h > Remaining Estimate: 2h > > The cast from {{mbstate_t*}} to {{unsigned short*}} in [{{iso2022.cpp}}|http://svn.apache.org/viewvc/stdcxx/trunk/src/iso2022.cpp] and subsequently dereferencing the pointer is unsafe because we don't know the alignment requirement of {{mbstate_t}} and because the type itself might be smaller that {{unsigned short}}, including as small as plain {{char}} as happens to be the case on IRIX. > {noformat} > aCC -c -mt -I$(TOPDIR)/include -I$(BUILDDIR)/include -AA +O2 +DD64 +w \ > +W392 +W655 +W684 +W818 +W819 +W849 +W2193 +W2236 +W2261 \ > +W2340 +W2401 +W2487 +W4227 +W4229 +W4231 +W4235 +W4237 \ > +W4249 +W4255 +W4272 +W4284 +W4285 +W4286 +Z $(TOPDIR)/src/iso2022.cpp > "$(TOPDIR)/src/iso2022.cpp", line 472: warning #4232-D: conversion from "mbstate_t *" to a more strictly aligned type "unsigned short *" may cause misaligned access > _RWSTD_REINTERPRET_CAST (ISO_2022_STATE_INDEX_T*, &state); > ^ > "$(TOPDIR)/src/iso2022.cpp", line 766, procedure __rw::__rw_iso2022jp_designate: warning #20200-D: Potential null pointer dereference through esc is detected (null definition:$(TOPDIR)/src/iso2022.cpp, line 679) > "$(TOPDIR)/src/iso2022.cpp", line 1543, procedure __rw::__rw_ucs4_to_interm: warning #20206-D: Out of bound access (buffer "db_array" byte range is [0 - 11], access range at [0 - 23]) > "$(TOPDIR)/src/iso2022.cpp", line 1588, procedure __rw::__rw_ucs4_to_interm: warning #20206-D: Out of bound access (buffer "db_array" byte range is [0 - 11], access range at [0 - 23]) > {noformat} -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
| Free embeddable forum powered by Nabble | Forum Help |