Issue Details (XML | Word | Printable)

Key: STDCXX-891
Type: Bug Bug
Status: Open Open
Priority: Minor Minor
Assignee: Unassigned
Reporter: Martin Sebor
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
C++ Standard Library

[HP aCC 6.16] warning 4232: potential misaligned access in iso2022.cpp

Created: 23/Apr/08 04:31 PM   Updated: 20/Jan/09 02:05 AM
Return to search
Component/s: 22. Localization
Affects Version/s: 4.1.2, 4.1.3, 4.1.4, 4.2.0
Fix Version/s: 4.2.2

Time Tracking:
Original Estimate: 2h
Original Estimate - 2h
Remaining Estimate: 2h
Remaining Estimate - 2h
Time Spent: Not Specified
Remaining Estimate - 2h

Environment: aCC: HP C/aC++ B3910B A.06.16 [Nov 26 2007]

Severity: Compiler Warning


 Description  « Hide
The cast from mbstate_t* to unsigned short* in 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.
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])


 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Martin Sebor added a comment - 20/Jan/09 02:05 AM
Lowered Priority as there is no test case showing a runtime error.