Add missing alignment padding to SetupRequest struct

Submitted by Alessandro Arzilli on Sept. 13, 2015, 10:49 a.m.

Details

Message ID 1442141353-19594-1-git-send-email-alessandro.arzilli@gmail.com
State New
Headers show

Commit Message

Alessandro Arzilli Sept. 13, 2015, 10:49 a.m.
Fields  AuthorizationProtocolName and AuthorizationProtocolData of
SetupRequest should be padded:

http://www.x.org/releases/current/doc/xproto/x11protocol.html#Encoding::Connection_Setup

The problem was discovered by github user pphaneuf while trying to use xgb
to write his own implementation of the connection handshake. Neither xgb
nor xcb actually use code generated for SetupRequest for the handshake,
which is why this bug went unnoticed.

https://github.com/BurntSushi/xgb/issues/24

Alessandro Arzilli.

---
 src/xproto.xml | 2 ++
 1 file changed, 2 insertions(+)

Patch hide | download patch | download mbox

diff --git a/src/xproto.xml b/src/xproto.xml
index bfb8a4c..143318b 100644
--- a/src/xproto.xml
+++ b/src/xproto.xml
@@ -195,9 +195,11 @@  authorization from the authors.
     <list type="char" name="authorization_protocol_name">
       <fieldref>authorization_protocol_name_len</fieldref>
     </list>
+    <pad align="4" />
     <list type="char" name="authorization_protocol_data">
       <fieldref>authorization_protocol_data_len</fieldref>
     </list>
+    <pad align="4" />
   </struct>
 
   <struct name="SetupFailed">

Comments

Alessandro Arzilli Jan. 23, 2017, 4:21 p.m.
Any reason this was not merged for xcb-proto 1.12?

Alessandro Arzilli.

On 13/09/2015 12:49, aarzilli wrote:
> Fields  AuthorizationProtocolName and AuthorizationProtocolData of
> SetupRequest should be padded:
>
> http://www.x.org/releases/current/doc/xproto/x11protocol.html#Encoding::Connection_Setup
>
> The problem was discovered by github user pphaneuf while trying to use xgb
> to write his own implementation of the connection handshake. Neither xgb
> nor xcb actually use code generated for SetupRequest for the handshake,
> which is why this bug went unnoticed.
>
> https://github.com/BurntSushi/xgb/issues/24
>
> Alessandro Arzilli.
>
> ---
>  src/xproto.xml | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/src/xproto.xml b/src/xproto.xml
> index bfb8a4c..143318b 100644
> --- a/src/xproto.xml
> +++ b/src/xproto.xml
> @@ -195,9 +195,11 @@ authorization from the authors.
>      <list type="char" name="authorization_protocol_name">
>        <fieldref>authorization_protocol_name_len</fieldref>
>      </list>
> +    <pad align="4" />
>      <list type="char" name="authorization_protocol_data">
>        <fieldref>authorization_protocol_data_len</fieldref>
>      </list>
> +    <pad align="4" />
>    </struct>
>
>    <struct name="SetupFailed">
>