[pcre-dev] [Bug 2090] New: Suspicious sequence of types cast…

Startseite
Nachricht löschen
Autor: admin
Datum:  
To: pcre-dev
Betreff: [pcre-dev] [Bug 2090] New: Suspicious sequence of types castings: memsize -> 32-bit integer -> memsize
https://bugs.exim.org/show_bug.cgi?id=2090

            Bug ID: 2090
           Summary: Suspicious sequence of types castings: memsize ->
                    32-bit integer -> memsize
           Product: PCRE
           Version: 10.23 (PCRE2)
          Hardware: x86-64
                OS: All
            Status: NEW
          Severity: bug
          Priority: medium
         Component: Code
          Assignee: ph10@???
          Reporter: egoroff@???
                CC: pcre-dev@???


Suspicious sequence of types castings: memsize -> 32-bit integer -> memsize.
The value being cast: '(p - string)'. pcre2_valid_utf.c

See lines 145, 151, 158

I suppose instead of casting to int:

*erroroffset = (int)(p - string);

casting to PCRE2_SIZE should be implemented:

*erroroffset = (PCRE2_SIZE)(p - string);

--
You are receiving this mail because:
You are on the CC list for the bug.