You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@stdcxx.apache.org by "Martin Sebor (JIRA)" <ji...@apache.org> on 2008/02/14 00:57:08 UTC

[jira] Created: (STDCXX-730) [HP aCC 6.15] potential null dererefence and out of bound access in iso2022.cpp

[HP aCC 6.15] potential null dererefence and out of bound access in iso2022.cpp
-------------------------------------------------------------------------------

                 Key: STDCXX-730
                 URL: https://issues.apache.org/jira/browse/STDCXX-730
             Project: C++ Standard Library
          Issue Type: Sub-task
          Components: 22. Localization
    Affects Versions: 4.2.0
         Environment: $ uname -sr && aCC -V
HP-UX B.11.31
aCC: HP C/aC++ B3910B A.06.16 [Nov 26 2007]

            Reporter: Martin Sebor
            Assignee: Martin Sebor
             Fix For: 4.2.1


We're getting a bunch of warnings from this file,. a couple of them looking serious:

{noformat}
"$(TOPDIR)/src/iso2022.cpp", line 470: 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)/include/loc/_localedef.h", line 160: remark #4298-D: 64 bit migration: addition result could be truncated before cast to bigger sized type
          return (wtolower_off - wtoupper_off) / sizeof (__rw_upper_elm);
                               ^

"$(TOPDIR)/include/loc/_localedef.h", line 164: remark #4298-D: 64 bit migration: addition result could be truncated before cast to bigger sized type
          return (wmask_off - wtolower_off) / sizeof (__rw_lower_elm);
                            ^

"$(TOPDIR)/include/loc/_localedef.h", line 168: remark #4298-D: 64 bit migration: addition result could be truncated before cast to bigger sized type
          return charmap_off - codeset_off;
                             ^

"$(TOPDIR)/include/loc/_localedef.h", line 172: remark #4298-D: 64 bit migration: addition result could be truncated before cast to bigger sized type
          return wtoupper_off - charmap_off;
                              ^

"$(TOPDIR)/include/loc/_localedef.h", line 122: remark #4299-D: 64 bit migration: multiply result could be truncated before cast to bigger sized type
          return *(_RWSTD_ARRAY_ELM (wchar_t, wchar_off, off * 2));
                                                             ^

"$(TOPDIR)/include/loc/_localedef.h", line 128: remark #4298-D: 64 bit migration: addition result could be truncated before cast to bigger sized type
          return *(_RWSTD_ARRAY_ELM (wchar_t, wchar_off, off * 2 + 1));
                                                                 ^

"$(TOPDIR)/src/iso2022.cpp", line 764, procedure __rw::__rw_ksc5601_to_iso2022: warning #20200-D: Potential null pointer dereference through esc is detected (null definition:$(TOPDIR)/src/iso2022.cpp, line 677)

"$(TOPDIR)/src/iso2022.cpp", line 1541, procedure __rw::__rw_ucs4_to_interm: warning #20206-D: Out of bound access (In expression "&db_array[(long long)i]", array "db_array" [$(TOPDIR)/src/iso2022.cpp:1525] (type: struct _noname [6]) has element range [0 .. 5], reading element range [0 .. 11].)

"$(TOPDIR)/src/iso2022.cpp", line 1586, procedure __rw::__rw_ucs4_to_interm: warning #20206-D: Out of bound access (In expression "&db_array[(long long)i]", array "db_array" [$(TOPDIR)/src/iso2022.cpp:1525] (type: struct _noname [6]) has element range [0 .. 5], reading element range [0 .. 11].)
{noformat}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (STDCXX-730) [HP aCC 6.15] potential null dererefence and out of bound access in iso2022.cpp

Posted by "Farid Zaripov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/STDCXX-730?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12589920#action_12589920 ] 

Farid Zaripov commented on STDCXX-730:
--------------------------------------

Merged in 4.2.x branch thus: http://svn.apache.org/viewvc?view=rev&revision=648752

> [HP aCC 6.15] potential null dererefence and out of bound access in iso2022.cpp
> -------------------------------------------------------------------------------
>
>                 Key: STDCXX-730
>                 URL: https://issues.apache.org/jira/browse/STDCXX-730
>             Project: C++ Standard Library
>          Issue Type: Sub-task
>          Components: 22. Localization
>    Affects Versions: 4.2.0
>         Environment: $ uname -sr && aCC -V
> HP-UX B.11.31
> aCC: HP C/aC++ B3910B A.06.16 [Nov 26 2007]
>            Reporter: Martin Sebor
>            Assignee: Martin Sebor
>             Fix For: 4.2.1
>
>   Original Estimate: 2h
>          Time Spent: 1h
>  Remaining Estimate: 1h
>
> We're getting a bunch of warnings from this file,. a couple of them looking serious:
> {noformat}
> "$(TOPDIR)/src/iso2022.cpp", line 470: 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)/include/loc/_localedef.h", line 160: remark #4298-D: 64 bit migration: addition result could be truncated before cast to bigger sized type
>           return (wtolower_off - wtoupper_off) / sizeof (__rw_upper_elm);
>                                ^
> "$(TOPDIR)/include/loc/_localedef.h", line 164: remark #4298-D: 64 bit migration: addition result could be truncated before cast to bigger sized type
>           return (wmask_off - wtolower_off) / sizeof (__rw_lower_elm);
>                             ^
> "$(TOPDIR)/include/loc/_localedef.h", line 168: remark #4298-D: 64 bit migration: addition result could be truncated before cast to bigger sized type
>           return charmap_off - codeset_off;
>                              ^
> "$(TOPDIR)/include/loc/_localedef.h", line 172: remark #4298-D: 64 bit migration: addition result could be truncated before cast to bigger sized type
>           return wtoupper_off - charmap_off;
>                               ^
> "$(TOPDIR)/include/loc/_localedef.h", line 122: remark #4299-D: 64 bit migration: multiply result could be truncated before cast to bigger sized type
>           return *(_RWSTD_ARRAY_ELM (wchar_t, wchar_off, off * 2));
>                                                              ^
> "$(TOPDIR)/include/loc/_localedef.h", line 128: remark #4298-D: 64 bit migration: addition result could be truncated before cast to bigger sized type
>           return *(_RWSTD_ARRAY_ELM (wchar_t, wchar_off, off * 2 + 1));
>                                                                  ^
> "$(TOPDIR)/src/iso2022.cpp", line 764, procedure __rw::__rw_ksc5601_to_iso2022: warning #20200-D: Potential null pointer dereference through esc is detected (null definition:$(TOPDIR)/src/iso2022.cpp, line 677)
> "$(TOPDIR)/src/iso2022.cpp", line 1541, procedure __rw::__rw_ucs4_to_interm: warning #20206-D: Out of bound access (In expression "&db_array[(long long)i]", array "db_array" [$(TOPDIR)/src/iso2022.cpp:1525] (type: struct _noname [6]) has element range [0 .. 5], reading element range [0 .. 11].)
> "$(TOPDIR)/src/iso2022.cpp", line 1586, procedure __rw::__rw_ucs4_to_interm: warning #20206-D: Out of bound access (In expression "&db_array[(long long)i]", array "db_array" [$(TOPDIR)/src/iso2022.cpp:1525] (type: struct _noname [6]) has element range [0 .. 5], reading element range [0 .. 11].)
> {noformat}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (STDCXX-730) [HP aCC 6.15] potential null dererefence and out of bound access in iso2022.cpp

Posted by "Martin Sebor (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/STDCXX-730?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Martin Sebor resolved STDCXX-730.
---------------------------------

    Resolution: Fixed

The warning's gone from nightly builds.

> [HP aCC 6.15] potential null dererefence and out of bound access in iso2022.cpp
> -------------------------------------------------------------------------------
>
>                 Key: STDCXX-730
>                 URL: https://issues.apache.org/jira/browse/STDCXX-730
>             Project: C++ Standard Library
>          Issue Type: Sub-task
>          Components: 22. Localization
>    Affects Versions: 4.2.0
>         Environment: $ uname -sr && aCC -V
> HP-UX B.11.31
> aCC: HP C/aC++ B3910B A.06.16 [Nov 26 2007]
>            Reporter: Martin Sebor
>            Assignee: Martin Sebor
>             Fix For: 4.2.1
>
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> We're getting a bunch of warnings from this file,. a couple of them looking serious:
> {noformat}
> "$(TOPDIR)/src/iso2022.cpp", line 470: 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)/include/loc/_localedef.h", line 160: remark #4298-D: 64 bit migration: addition result could be truncated before cast to bigger sized type
>           return (wtolower_off - wtoupper_off) / sizeof (__rw_upper_elm);
>                                ^
> "$(TOPDIR)/include/loc/_localedef.h", line 164: remark #4298-D: 64 bit migration: addition result could be truncated before cast to bigger sized type
>           return (wmask_off - wtolower_off) / sizeof (__rw_lower_elm);
>                             ^
> "$(TOPDIR)/include/loc/_localedef.h", line 168: remark #4298-D: 64 bit migration: addition result could be truncated before cast to bigger sized type
>           return charmap_off - codeset_off;
>                              ^
> "$(TOPDIR)/include/loc/_localedef.h", line 172: remark #4298-D: 64 bit migration: addition result could be truncated before cast to bigger sized type
>           return wtoupper_off - charmap_off;
>                               ^
> "$(TOPDIR)/include/loc/_localedef.h", line 122: remark #4299-D: 64 bit migration: multiply result could be truncated before cast to bigger sized type
>           return *(_RWSTD_ARRAY_ELM (wchar_t, wchar_off, off * 2));
>                                                              ^
> "$(TOPDIR)/include/loc/_localedef.h", line 128: remark #4298-D: 64 bit migration: addition result could be truncated before cast to bigger sized type
>           return *(_RWSTD_ARRAY_ELM (wchar_t, wchar_off, off * 2 + 1));
>                                                                  ^
> "$(TOPDIR)/src/iso2022.cpp", line 764, procedure __rw::__rw_ksc5601_to_iso2022: warning #20200-D: Potential null pointer dereference through esc is detected (null definition:$(TOPDIR)/src/iso2022.cpp, line 677)
> "$(TOPDIR)/src/iso2022.cpp", line 1541, procedure __rw::__rw_ucs4_to_interm: warning #20206-D: Out of bound access (In expression "&db_array[(long long)i]", array "db_array" [$(TOPDIR)/src/iso2022.cpp:1525] (type: struct _noname [6]) has element range [0 .. 5], reading element range [0 .. 11].)
> "$(TOPDIR)/src/iso2022.cpp", line 1586, procedure __rw::__rw_ucs4_to_interm: warning #20206-D: Out of bound access (In expression "&db_array[(long long)i]", array "db_array" [$(TOPDIR)/src/iso2022.cpp:1525] (type: struct _noname [6]) has element range [0 .. 5], reading element range [0 .. 11].)
> {noformat}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.