diff options
author | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2015-03-13 16:30:55 +0100 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2015-03-13 21:46:27 +0100 |
commit | 20bd6799b299fc16a58f60d4d608c77450dcb265 (patch) | |
tree | 378615dfdacd0624da371ea83a15811a897bdd11 | |
parent | ca87773c64d62a1fc0cc9592894c21239bdbf1c0 (diff) | |
download | gnutls-20bd6799b299fc16a58f60d4d608c77450dcb265.tar.gz |
Fixed handling of supplemental data with types > 255.
Patch by Thierry Quemerais.
-rw-r--r-- | lib/gnutls_supplemental.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/gnutls_supplemental.c b/lib/gnutls_supplemental.c index 56ca1e9f8c..e515273e74 100644 --- a/lib/gnutls_supplemental.c +++ b/lib/gnutls_supplemental.c @@ -131,8 +131,8 @@ _gnutls_gen_supplemental(gnutls_session_t session, gnutls_buffer_st * buf) /* If data were added, store type+length, otherwise reset. */ if (buf->length > sizepos + 4) { - buf->data[sizepos] = 0; - buf->data[sizepos + 1] = p->type; + buf->data[sizepos] = (p->type >> 8) & 0xFF; + buf->data[sizepos + 1] = p->type & 0xFF; buf->data[sizepos + 2] = ((buf->length - sizepos - 4) >> 8) & 0xFF; buf->data[sizepos + 3] = |