Issue Details (XML | Word | Printable)

Key: STDCXX-753
Type: Sub-task Sub-task
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Martin Sebor
Reporter: Scott (Yu) Zhong
Votes: 0
Watchers: 0
Operations

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

[HP aCC 6.16] Forming out of bound address in charmap.cpp

Created: 13/Mar/08 08:24 PM   Updated: 22/Apr/08 10:31 PM
Return to search
Component/s: 20. General Utilities
Affects Version/s: 4.2.0
Fix Version/s: 4.2.1

Time Tracking:
Original Estimate: 2h
Original Estimate - 2h
Remaining Estimate: 1h
Time Spent - 1h Remaining Estimate - 1h
Time Spent: 1h
Time Spent - 1h Remaining Estimate - 1h

Environment:
$ uname -sr && aCC -V
HP-UX B.11.31
aCC: HP C/aC++ B3910B A.06.16 [Nov 26 2007]

Resolution Date: 22/Apr/08 10:30 PM


 Description  « Hide
aCC -c -mt -I/amd/devco/scottz/stdcxx/4.2.x/include -I/build/scottz/12d/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 /amd/devco/scottz/stdcxx/4.2.x/u
til/charmap.cpp

"/amd/devco/scottz/stdcxx/4.2.x/util/charmap.cpp", line 222, procedure convert_to_ucs: warning #20208-D: Forming out of bound address (In expression "(const unsigned char*)utf8_enc+num_bytes+-1", variable "utf8_enc" [/amd/devco/scottz/stdcxx/4.2.x/util/charmap.cpp:674] (type: char [5]) has byte range [0 .. 4], forming address byte range [-1 .. 5].)



 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Scott (Yu) Zhong added a comment - 31/Mar/08 04:47 AM
add compile line to description

Martin Sebor added a comment - 22/Apr/08 10:09 PM
This actually indicates at least a theoretical problem with the utility: the size of the destination buffer used for the conversion to UTF-8 is MB_LEN_MAX + 1 bytes. On HP-UX, the value of MB_LEN_MAX is 4, which is 2 less than the longest UTF-8 character the utility could otherwise process.

Martin Sebor added a comment - 22/Apr/08 10:30 PM
Warning silenced in r650678.