You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by "martin goodall (Jira)" <xe...@xml.apache.org> on 2019/11/04 14:33:00 UTC

[jira] [Comment Edited] (XERCESC-2179) access violation in win32transservice.cpp with 64 bit compile

    [ https://issues.apache.org/jira/browse/XERCESC-2179?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16966698#comment-16966698 ] 

martin goodall edited comment on XERCESC-2179 at 11/4/19 2:32 PM:
------------------------------------------------------------------

the code is wrong - on a 64 bit platform, LPDWORD is a far dword which is 64 bits (I think we all agree). I think the thing that's wrong in the above text is that "unsigned int" (32 bits) was being used as the variable, not unsigned "unsigned long" (64 bits). unsigned int is 32 bits and platform dependent. see [https://docs.microsoft.com/en-us/cpp/cpp/data-type-ranges?view=vs-2019] which documents the lengths. Also at the end of the day, printf...sizeof() is pretty conclusive......as well as the code no longer segs :)

Also not the comment from the document

"{color:#171717}The {color}*int*{color:#171717} and {color}*unsigned int*{color:#171717} types have a size of four bytes. However, portable code should not depend on the size of {color}*int*{color:#171717} because the language standard allows this to be implementation-specific.{color}"


was (Author: martgoodall):
the code is wrong - on a 64 bit platform, LPDWORD is a far dword which is 64 bits (I think we all agree). I think the thing that's wrong in the above text is that "unsigned int" (32 bits) was being used as the variable, not unsigned "unsigned long" (64 bits). unsigned int is 32 bits and platform dependent. see [https://docs.microsoft.com/en-us/cpp/cpp/data-type-ranges?view=vs-2019] which documents the lengths. Also at the end of the day, printf...sizeof() is pretty conclusive......as well as the code no longer segs :)

> access violation in win32transservice.cpp with 64 bit compile
> -------------------------------------------------------------
>
>                 Key: XERCESC-2179
>                 URL: https://issues.apache.org/jira/browse/XERCESC-2179
>             Project: Xerces-C++
>          Issue Type: Bug
>          Components: DOM
>    Affects Versions: 3.2.2
>            Reporter: martin goodall
>            Assignee: Alberto Massari
>            Priority: Blocker
>             Fix For: 3.2.3
>
>         Attachments: Win32TransService.cpp
>
>
> calls to ::Reg... to get registry info are passing in stack variables that are 8 bytes long into functions that overwrite 16 bytes, causing memory overwrite and very random segs.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org